Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef CYTHON_INLINE
571 : #if defined(__clang__)
572 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
573 : #elif defined(__GNUC__)
574 : #define CYTHON_INLINE __inline__
575 : #elif defined(_MSC_VER)
576 : #define CYTHON_INLINE __inline
577 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
578 : #define CYTHON_INLINE inline
579 : #else
580 : #define CYTHON_INLINE
581 : #endif
582 : #endif
583 :
584 : #define __PYX_BUILD_PY_SSIZE_T "n"
585 : #define CYTHON_FORMAT_SSIZE_T "z"
586 : #if PY_MAJOR_VERSION < 3
587 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
588 : #define __Pyx_DefaultClassType PyClass_Type
589 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
590 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
591 : #else
592 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
593 : #define __Pyx_DefaultClassType PyType_Type
594 : #if CYTHON_COMPILING_IN_LIMITED_API
595 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
596 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
597 : PyObject *fv, PyObject *cell, PyObject* fn,
598 : PyObject *name, int fline, PyObject *lnos) {
599 : PyObject *exception_table = NULL;
600 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
601 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
602 : PyObject *version_info;
603 : PyObject *py_minor_version = NULL;
604 : #endif
605 : long minor_version = 0;
606 : PyObject *type, *value, *traceback;
607 : PyErr_Fetch(&type, &value, &traceback);
608 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
609 : minor_version = 11;
610 : #else
611 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
612 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
613 : minor_version = PyLong_AsLong(py_minor_version);
614 : Py_DECREF(py_minor_version);
615 : if (minor_version == -1 && PyErr_Occurred()) goto end;
616 : #endif
617 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
618 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
619 : if (minor_version <= 7) {
620 : (void)p;
621 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
622 : c, n, v, fn, name, fline, lnos, fv, cell);
623 : } else if (minor_version <= 10) {
624 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
625 : c, n, v, fn, name, fline, lnos, fv, cell);
626 : } else {
627 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
628 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
629 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
630 : }
631 : end:
632 : Py_XDECREF(code_type);
633 : Py_XDECREF(exception_table);
634 : Py_XDECREF(types_module);
635 : if (type) {
636 : PyErr_Restore(type, value, traceback);
637 : }
638 : return result;
639 : }
640 : #ifndef CO_OPTIMIZED
641 : #define CO_OPTIMIZED 0x0001
642 : #endif
643 : #ifndef CO_NEWLOCALS
644 : #define CO_NEWLOCALS 0x0002
645 : #endif
646 : #ifndef CO_VARARGS
647 : #define CO_VARARGS 0x0004
648 : #endif
649 : #ifndef CO_VARKEYWORDS
650 : #define CO_VARKEYWORDS 0x0008
651 : #endif
652 : #ifndef CO_ASYNC_GENERATOR
653 : #define CO_ASYNC_GENERATOR 0x0200
654 : #endif
655 : #ifndef CO_GENERATOR
656 : #define CO_GENERATOR 0x0020
657 : #endif
658 : #ifndef CO_COROUTINE
659 : #define CO_COROUTINE 0x0080
660 : #endif
661 : #elif PY_VERSION_HEX >= 0x030B0000
662 21 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
663 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
664 : PyObject *fv, PyObject *cell, PyObject* fn,
665 : PyObject *name, int fline, PyObject *lnos) {
666 21 : PyCodeObject *result;
667 21 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
668 21 : if (!empty_bytes) return NULL;
669 21 : result =
670 : #if PY_VERSION_HEX >= 0x030C0000
671 21 : PyUnstable_Code_NewWithPosOnlyArgs
672 : #else
673 : PyCode_NewWithPosOnlyArgs
674 : #endif
675 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
676 21 : Py_DECREF(empty_bytes);
677 : return result;
678 : }
679 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
680 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
681 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
682 : #else
683 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
684 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
685 : #endif
686 : #endif
687 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
688 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
689 : #else
690 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
691 : #endif
692 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
693 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
694 : #else
695 : #define __Pyx_Py_Is(x, y) ((x) == (y))
696 : #endif
697 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
698 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
699 : #else
700 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
701 : #endif
702 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
703 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
704 : #else
705 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
706 : #endif
707 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
708 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
709 : #else
710 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
711 : #endif
712 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
713 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
714 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
715 : #else
716 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
717 : #endif
718 : #ifndef CO_COROUTINE
719 : #define CO_COROUTINE 0x80
720 : #endif
721 : #ifndef CO_ASYNC_GENERATOR
722 : #define CO_ASYNC_GENERATOR 0x200
723 : #endif
724 : #ifndef Py_TPFLAGS_CHECKTYPES
725 : #define Py_TPFLAGS_CHECKTYPES 0
726 : #endif
727 : #ifndef Py_TPFLAGS_HAVE_INDEX
728 : #define Py_TPFLAGS_HAVE_INDEX 0
729 : #endif
730 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
731 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
732 : #endif
733 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
734 : #define Py_TPFLAGS_HAVE_FINALIZE 0
735 : #endif
736 : #ifndef Py_TPFLAGS_SEQUENCE
737 : #define Py_TPFLAGS_SEQUENCE 0
738 : #endif
739 : #ifndef Py_TPFLAGS_MAPPING
740 : #define Py_TPFLAGS_MAPPING 0
741 : #endif
742 : #ifndef METH_STACKLESS
743 : #define METH_STACKLESS 0
744 : #endif
745 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
746 : #ifndef METH_FASTCALL
747 : #define METH_FASTCALL 0x80
748 : #endif
749 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
750 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
751 : Py_ssize_t nargs, PyObject *kwnames);
752 : #else
753 : #if PY_VERSION_HEX >= 0x030d00A4
754 : # define __Pyx_PyCFunctionFast PyCFunctionFast
755 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
756 : #else
757 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
758 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
759 : #endif
760 : #endif
761 : #if CYTHON_METH_FASTCALL
762 : #define __Pyx_METH_FASTCALL METH_FASTCALL
763 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
764 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
765 : #else
766 : #define __Pyx_METH_FASTCALL METH_VARARGS
767 : #define __Pyx_PyCFunction_FastCall PyCFunction
768 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
769 : #endif
770 : #if CYTHON_VECTORCALL
771 : #define __pyx_vectorcallfunc vectorcallfunc
772 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
773 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
774 : #elif CYTHON_BACKPORT_VECTORCALL
775 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
776 : size_t nargsf, PyObject *kwnames);
777 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
778 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
779 : #else
780 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
781 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
782 : #endif
783 : #if PY_MAJOR_VERSION >= 0x030900B1
784 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
785 : #else
786 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
787 : #endif
788 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
789 : #if CYTHON_COMPILING_IN_CPYTHON
790 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
791 : #elif !CYTHON_COMPILING_IN_LIMITED_API
792 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
793 : #endif
794 : #if CYTHON_COMPILING_IN_CPYTHON
795 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
796 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
797 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
798 : }
799 : #endif
800 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
801 : #if CYTHON_COMPILING_IN_LIMITED_API
802 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
803 : #else
804 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
805 : #endif
806 : }
807 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
808 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
809 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
810 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
811 : #else
812 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
813 : #define __Pyx_PyCMethod PyCMethod
814 : #endif
815 : #ifndef METH_METHOD
816 : #define METH_METHOD 0x200
817 : #endif
818 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
819 : #define PyObject_Malloc(s) PyMem_Malloc(s)
820 : #define PyObject_Free(p) PyMem_Free(p)
821 : #define PyObject_Realloc(p) PyMem_Realloc(p)
822 : #endif
823 : #if CYTHON_COMPILING_IN_LIMITED_API
824 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
825 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
826 : #else
827 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
828 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
829 : #endif
830 : #if CYTHON_COMPILING_IN_LIMITED_API
831 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
832 : #elif !CYTHON_FAST_THREAD_STATE
833 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
834 : #elif PY_VERSION_HEX >= 0x030d00A1
835 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
836 : #elif PY_VERSION_HEX >= 0x03060000
837 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
838 : #elif PY_VERSION_HEX >= 0x03000000
839 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
840 : #else
841 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
842 : #endif
843 : #if CYTHON_COMPILING_IN_LIMITED_API
844 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
845 : {
846 : void *result;
847 : result = PyModule_GetState(op);
848 : if (!result)
849 : Py_FatalError("Couldn't find the module state");
850 : return result;
851 : }
852 : #endif
853 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
854 : #if CYTHON_COMPILING_IN_LIMITED_API
855 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
856 : #else
857 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
858 : #endif
859 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
860 : #include "pythread.h"
861 : #define Py_tss_NEEDS_INIT 0
862 : typedef int Py_tss_t;
863 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
864 : *key = PyThread_create_key();
865 : return 0;
866 : }
867 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
868 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
869 : *key = Py_tss_NEEDS_INIT;
870 : return key;
871 : }
872 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
873 : PyObject_Free(key);
874 : }
875 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
876 : return *key != Py_tss_NEEDS_INIT;
877 : }
878 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
879 : PyThread_delete_key(*key);
880 : *key = Py_tss_NEEDS_INIT;
881 : }
882 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
883 : return PyThread_set_key_value(*key, value);
884 : }
885 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
886 : return PyThread_get_key_value(*key);
887 : }
888 : #endif
889 : #if PY_MAJOR_VERSION < 3
890 : #if CYTHON_COMPILING_IN_PYPY
891 : #if PYPY_VERSION_NUM < 0x07030600
892 : #if defined(__cplusplus) && __cplusplus >= 201402L
893 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
894 : #elif defined(__GNUC__) || defined(__clang__)
895 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
896 : #elif defined(_MSC_VER)
897 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
898 : #endif
899 : static CYTHON_INLINE int PyGILState_Check(void) {
900 : return 0;
901 : }
902 : #else // PYPY_VERSION_NUM < 0x07030600
903 : #endif // PYPY_VERSION_NUM < 0x07030600
904 : #else
905 : static CYTHON_INLINE int PyGILState_Check(void) {
906 : PyThreadState * tstate = _PyThreadState_Current;
907 : return tstate && (tstate == PyGILState_GetThisThreadState());
908 : }
909 : #endif
910 : #endif
911 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
912 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
913 : #else
914 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
915 : #endif
916 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
917 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
918 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
919 : #else
920 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
921 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
922 : #endif
923 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
924 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
925 17 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
926 17 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
927 17 : if (res == NULL) PyErr_Clear();
928 17 : return res;
929 : }
930 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
931 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
932 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
933 : #else
934 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
935 : #if CYTHON_COMPILING_IN_PYPY
936 : return PyDict_GetItem(dict, name);
937 : #else
938 : PyDictEntry *ep;
939 : PyDictObject *mp = (PyDictObject*) dict;
940 : long hash = ((PyStringObject *) name)->ob_shash;
941 : assert(hash != -1);
942 : ep = (mp->ma_lookup)(mp, name, hash);
943 : if (ep == NULL) {
944 : return NULL;
945 : }
946 : return ep->me_value;
947 : #endif
948 : }
949 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
950 : #endif
951 : #if CYTHON_USE_TYPE_SLOTS
952 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
953 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
954 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
955 : #else
956 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
957 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
958 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
959 : #endif
960 : #if CYTHON_COMPILING_IN_LIMITED_API
961 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
962 : #else
963 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
964 : #endif
965 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
966 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
967 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
968 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
969 : PyObject_GC_Del(obj);\
970 : Py_DECREF(type);\
971 : }
972 : #else
973 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
974 : #endif
975 : #if CYTHON_COMPILING_IN_LIMITED_API
976 : #define CYTHON_PEP393_ENABLED 1
977 : #define __Pyx_PyUnicode_READY(op) (0)
978 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
979 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
980 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
981 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
982 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
983 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
984 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
985 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
986 : #define CYTHON_PEP393_ENABLED 1
987 : #if PY_VERSION_HEX >= 0x030C0000
988 : #define __Pyx_PyUnicode_READY(op) (0)
989 : #else
990 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
991 : 0 : _PyUnicode_Ready((PyObject *)(op)))
992 : #endif
993 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
994 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
995 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
996 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
997 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
998 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
999 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1000 : #if PY_VERSION_HEX >= 0x030C0000
1001 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1002 : #else
1003 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1004 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1005 : #else
1006 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1007 : #endif
1008 : #endif
1009 : #else
1010 : #define CYTHON_PEP393_ENABLED 0
1011 : #define PyUnicode_1BYTE_KIND 1
1012 : #define PyUnicode_2BYTE_KIND 2
1013 : #define PyUnicode_4BYTE_KIND 4
1014 : #define __Pyx_PyUnicode_READY(op) (0)
1015 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1016 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1017 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1018 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1019 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1020 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1021 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1023 : #endif
1024 : #if CYTHON_COMPILING_IN_PYPY
1025 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1026 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1027 : #else
1028 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1029 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1030 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1031 : #endif
1032 : #if CYTHON_COMPILING_IN_PYPY
1033 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1034 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1035 : #endif
1036 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1037 : #undef PyUnicode_Contains
1038 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1039 : #endif
1040 : #if !defined(PyByteArray_Check)
1041 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1042 : #endif
1043 : #if !defined(PyObject_Format)
1044 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1045 : #endif
1046 : #endif
1047 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1048 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1049 : #if PY_MAJOR_VERSION >= 3
1050 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1051 : #else
1052 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1053 : #endif
1054 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1055 : #define PyObject_ASCII(o) PyObject_Repr(o)
1056 : #endif
1057 : #if PY_MAJOR_VERSION >= 3
1058 : #define PyBaseString_Type PyUnicode_Type
1059 : #define PyStringObject PyUnicodeObject
1060 : #define PyString_Type PyUnicode_Type
1061 : #define PyString_Check PyUnicode_Check
1062 : #define PyString_CheckExact PyUnicode_CheckExact
1063 : #ifndef PyObject_Unicode
1064 : #define PyObject_Unicode PyObject_Str
1065 : #endif
1066 : #endif
1067 : #if PY_MAJOR_VERSION >= 3
1068 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1069 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1070 : #else
1071 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1072 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1073 : #endif
1074 : #if CYTHON_COMPILING_IN_CPYTHON
1075 : #define __Pyx_PySequence_ListKeepNew(obj)\
1076 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1077 : #else
1078 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1079 : #endif
1080 : #ifndef PySet_CheckExact
1081 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1082 : #endif
1083 : #if PY_VERSION_HEX >= 0x030900A4
1084 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1085 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1086 : #else
1087 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1088 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1089 : #endif
1090 : #if CYTHON_ASSUME_SAFE_MACROS
1091 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1092 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1093 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1094 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1095 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1096 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1097 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1098 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1099 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1100 : #else
1101 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1102 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1103 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1104 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1105 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1106 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1107 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1108 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1109 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1110 : #endif
1111 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1112 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1113 : #else
1114 9 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1115 9 : PyObject *module = PyImport_AddModule(name);
1116 9 : Py_XINCREF(module);
1117 9 : return module;
1118 : }
1119 : #endif
1120 : #if PY_MAJOR_VERSION >= 3
1121 : #define PyIntObject PyLongObject
1122 : #define PyInt_Type PyLong_Type
1123 : #define PyInt_Check(op) PyLong_Check(op)
1124 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1125 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1126 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1127 : #define PyInt_FromString PyLong_FromString
1128 : #define PyInt_FromUnicode PyLong_FromUnicode
1129 : #define PyInt_FromLong PyLong_FromLong
1130 : #define PyInt_FromSize_t PyLong_FromSize_t
1131 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1132 : #define PyInt_AsLong PyLong_AsLong
1133 : #define PyInt_AS_LONG PyLong_AS_LONG
1134 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1135 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1136 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1137 : #define PyNumber_Int PyNumber_Long
1138 : #else
1139 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1140 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1141 : #endif
1142 : #if PY_MAJOR_VERSION >= 3
1143 : #define PyBoolObject PyLongObject
1144 : #endif
1145 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1146 : #ifndef PyUnicode_InternFromString
1147 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1148 : #endif
1149 : #endif
1150 : #if PY_VERSION_HEX < 0x030200A4
1151 : typedef long Py_hash_t;
1152 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1153 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1154 : #else
1155 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1156 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1157 : #endif
1158 : #if CYTHON_USE_ASYNC_SLOTS
1159 : #if PY_VERSION_HEX >= 0x030500B1
1160 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1161 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1162 : #else
1163 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1164 : #endif
1165 : #else
1166 : #define __Pyx_PyType_AsAsync(obj) NULL
1167 : #endif
1168 : #ifndef __Pyx_PyAsyncMethodsStruct
1169 : typedef struct {
1170 : unaryfunc am_await;
1171 : unaryfunc am_aiter;
1172 : unaryfunc am_anext;
1173 : } __Pyx_PyAsyncMethodsStruct;
1174 : #endif
1175 :
1176 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1177 : #if !defined(_USE_MATH_DEFINES)
1178 : #define _USE_MATH_DEFINES
1179 : #endif
1180 : #endif
1181 : #include <math.h>
1182 : #ifdef NAN
1183 : #define __PYX_NAN() ((float) NAN)
1184 : #else
1185 : static CYTHON_INLINE float __PYX_NAN() {
1186 : float value;
1187 : memset(&value, 0xFF, sizeof(value));
1188 : return value;
1189 : }
1190 : #endif
1191 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1192 : #define __Pyx_truncl trunc
1193 : #else
1194 : #define __Pyx_truncl truncl
1195 : #endif
1196 :
1197 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1198 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1199 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1200 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1201 :
1202 : #ifdef CYTHON_EXTERN_C
1203 : #undef __PYX_EXTERN_C
1204 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1205 : #elif defined(__PYX_EXTERN_C)
1206 : #ifdef _MSC_VER
1207 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1208 : #else
1209 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1210 : #endif
1211 : #else
1212 : #ifdef __cplusplus
1213 : #define __PYX_EXTERN_C extern "C"
1214 : #else
1215 : #define __PYX_EXTERN_C extern
1216 : #endif
1217 : #endif
1218 :
1219 : #define __PYX_HAVE__scipy__sparse__csgraph___flow
1220 : #define __PYX_HAVE_API__scipy__sparse__csgraph___flow
1221 : /* Early includes */
1222 : #include <string.h>
1223 : #include <stdio.h>
1224 :
1225 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1226 :
1227 : #include "numpy/arrayobject.h"
1228 : #include "numpy/ndarrayobject.h"
1229 : #include "numpy/ndarraytypes.h"
1230 : #include "numpy/arrayscalars.h"
1231 : #include "numpy/ufuncobject.h"
1232 : #include "pythread.h"
1233 : #include <stdlib.h>
1234 : #ifdef _OPENMP
1235 : #include <omp.h>
1236 : #endif /* _OPENMP */
1237 :
1238 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1239 : #define CYTHON_WITHOUT_ASSERTIONS
1240 : #endif
1241 :
1242 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1243 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1244 :
1245 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1246 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1247 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1248 : #define __PYX_DEFAULT_STRING_ENCODING ""
1249 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1250 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1251 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1252 : #define __Pyx_long_cast(x) ((long)x)
1253 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1254 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1255 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1256 : likely(v < (type)PY_SSIZE_T_MAX ||\
1257 : v == (type)PY_SSIZE_T_MAX) &&\
1258 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1259 : v == (type)PY_SSIZE_T_MIN))) ||\
1260 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1261 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1262 : v == (type)PY_SSIZE_T_MAX))) )
1263 0 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1264 0 : return (size_t) i < (size_t) limit;
1265 : }
1266 : #if defined (__cplusplus) && __cplusplus >= 201103L
1267 : #include <cstdlib>
1268 : #define __Pyx_sst_abs(value) std::abs(value)
1269 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1270 : #define __Pyx_sst_abs(value) abs(value)
1271 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1272 : #define __Pyx_sst_abs(value) labs(value)
1273 : #elif defined (_MSC_VER)
1274 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1275 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1276 : #define __Pyx_sst_abs(value) llabs(value)
1277 : #elif defined (__GNUC__)
1278 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1279 : #else
1280 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1281 : #endif
1282 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1283 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1284 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1285 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1286 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1287 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1288 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1289 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1290 : #if PY_MAJOR_VERSION < 3
1291 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1292 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1293 : #else
1294 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1295 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1296 : #endif
1297 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1298 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1299 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1300 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1301 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1302 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1303 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1304 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1305 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1306 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1307 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1308 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1309 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1310 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1311 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1312 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1313 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1314 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1315 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1316 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1317 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1318 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1319 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1320 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1321 : #define __Pyx_PySequence_Tuple(obj)\
1322 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1323 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1324 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1325 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1326 : #if CYTHON_ASSUME_SAFE_MACROS
1327 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1328 : #else
1329 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1330 : #endif
1331 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1332 : #if PY_MAJOR_VERSION >= 3
1333 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1334 : #else
1335 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1336 : #endif
1337 : #if CYTHON_USE_PYLONG_INTERNALS
1338 : #if PY_VERSION_HEX >= 0x030C00A7
1339 : #ifndef _PyLong_SIGN_MASK
1340 : #define _PyLong_SIGN_MASK 3
1341 : #endif
1342 : #ifndef _PyLong_NON_SIZE_BITS
1343 : #define _PyLong_NON_SIZE_BITS 3
1344 : #endif
1345 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1346 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1347 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1348 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1349 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1350 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1351 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1352 : #define __Pyx_PyLong_SignedDigitCount(x)\
1353 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1354 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1355 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1356 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1357 : #else
1358 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1359 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1360 : #endif
1361 : typedef Py_ssize_t __Pyx_compact_pylong;
1362 : typedef size_t __Pyx_compact_upylong;
1363 : #else
1364 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1365 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1366 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1367 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1368 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1369 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1370 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1371 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1372 : #define __Pyx_PyLong_CompactValue(x)\
1373 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1374 : typedef sdigit __Pyx_compact_pylong;
1375 : typedef digit __Pyx_compact_upylong;
1376 : #endif
1377 : #if PY_VERSION_HEX >= 0x030C00A5
1378 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1379 : #else
1380 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1381 : #endif
1382 : #endif
1383 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1384 : #include <string.h>
1385 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1386 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1387 : PyObject* sys;
1388 : PyObject* default_encoding = NULL;
1389 : PyObject* ascii_chars_u = NULL;
1390 : PyObject* ascii_chars_b = NULL;
1391 : const char* default_encoding_c;
1392 : sys = PyImport_ImportModule("sys");
1393 : if (!sys) goto bad;
1394 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1395 : Py_DECREF(sys);
1396 : if (!default_encoding) goto bad;
1397 : default_encoding_c = PyBytes_AsString(default_encoding);
1398 : if (!default_encoding_c) goto bad;
1399 : if (strcmp(default_encoding_c, "ascii") == 0) {
1400 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1401 : } else {
1402 : char ascii_chars[128];
1403 : int c;
1404 : for (c = 0; c < 128; c++) {
1405 : ascii_chars[c] = (char) c;
1406 : }
1407 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1408 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1409 : if (!ascii_chars_u) goto bad;
1410 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1411 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1412 : PyErr_Format(
1413 : PyExc_ValueError,
1414 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1415 : default_encoding_c);
1416 : goto bad;
1417 : }
1418 : Py_DECREF(ascii_chars_u);
1419 : Py_DECREF(ascii_chars_b);
1420 : }
1421 : Py_DECREF(default_encoding);
1422 : return 0;
1423 : bad:
1424 : Py_XDECREF(default_encoding);
1425 : Py_XDECREF(ascii_chars_u);
1426 : Py_XDECREF(ascii_chars_b);
1427 : return -1;
1428 : }
1429 : #endif
1430 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1431 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1432 : #else
1433 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1434 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1435 : #include <string.h>
1436 : static char* __PYX_DEFAULT_STRING_ENCODING;
1437 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1438 : PyObject* sys;
1439 : PyObject* default_encoding = NULL;
1440 : char* default_encoding_c;
1441 : sys = PyImport_ImportModule("sys");
1442 : if (!sys) goto bad;
1443 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1444 : Py_DECREF(sys);
1445 : if (!default_encoding) goto bad;
1446 : default_encoding_c = PyBytes_AsString(default_encoding);
1447 : if (!default_encoding_c) goto bad;
1448 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1449 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1450 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1451 : Py_DECREF(default_encoding);
1452 : return 0;
1453 : bad:
1454 : Py_XDECREF(default_encoding);
1455 : return -1;
1456 : }
1457 : #endif
1458 : #endif
1459 :
1460 :
1461 : /* Test for GCC > 2.95 */
1462 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1463 : #define likely(x) __builtin_expect(!!(x), 1)
1464 : #define unlikely(x) __builtin_expect(!!(x), 0)
1465 : #else /* !__GNUC__ or GCC < 2.95 */
1466 : #define likely(x) (x)
1467 : #define unlikely(x) (x)
1468 : #endif /* __GNUC__ */
1469 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1470 :
1471 : #if !CYTHON_USE_MODULE_STATE
1472 : static PyObject *__pyx_m = NULL;
1473 : #endif
1474 : static int __pyx_lineno;
1475 : static int __pyx_clineno = 0;
1476 : static const char * __pyx_cfilenm = __FILE__;
1477 : static const char *__pyx_filename;
1478 :
1479 : /* Header.proto */
1480 : #if !defined(CYTHON_CCOMPLEX)
1481 : #if defined(__cplusplus)
1482 : #define CYTHON_CCOMPLEX 1
1483 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1484 : #define CYTHON_CCOMPLEX 1
1485 : #else
1486 : #define CYTHON_CCOMPLEX 0
1487 : #endif
1488 : #endif
1489 : #if CYTHON_CCOMPLEX
1490 : #ifdef __cplusplus
1491 : #include <complex>
1492 : #else
1493 : #include <complex.h>
1494 : #endif
1495 : #endif
1496 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1497 : #undef _Complex_I
1498 : #define _Complex_I 1.0fj
1499 : #endif
1500 :
1501 : /* #### Code section: filename_table ### */
1502 :
1503 : static const char *__pyx_f[] = {
1504 : "_flow.pyx",
1505 : "<stringsource>",
1506 : "__init__.cython-30.pxd",
1507 : "type.pxd",
1508 : "parameters.pxi",
1509 : };
1510 : /* #### Code section: utility_code_proto_before_types ### */
1511 : /* ForceInitThreads.proto */
1512 : #ifndef __PYX_FORCE_INIT_THREADS
1513 : #define __PYX_FORCE_INIT_THREADS 0
1514 : #endif
1515 :
1516 : /* NoFastGil.proto */
1517 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1518 : #define __Pyx_PyGILState_Release PyGILState_Release
1519 : #define __Pyx_FastGIL_Remember()
1520 : #define __Pyx_FastGIL_Forget()
1521 : #define __Pyx_FastGilFuncInit()
1522 :
1523 : /* BufferFormatStructs.proto */
1524 : struct __Pyx_StructField_;
1525 : #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1526 : typedef struct {
1527 : const char* name;
1528 : struct __Pyx_StructField_* fields;
1529 : size_t size;
1530 : size_t arraysize[8];
1531 : int ndim;
1532 : char typegroup;
1533 : char is_unsigned;
1534 : int flags;
1535 : } __Pyx_TypeInfo;
1536 : typedef struct __Pyx_StructField_ {
1537 : __Pyx_TypeInfo* type;
1538 : const char* name;
1539 : size_t offset;
1540 : } __Pyx_StructField;
1541 : typedef struct {
1542 : __Pyx_StructField* field;
1543 : size_t parent_offset;
1544 : } __Pyx_BufFmt_StackElem;
1545 : typedef struct {
1546 : __Pyx_StructField root;
1547 : __Pyx_BufFmt_StackElem* head;
1548 : size_t fmt_offset;
1549 : size_t new_count, enc_count;
1550 : size_t struct_alignment;
1551 : int is_complex;
1552 : char enc_type;
1553 : char new_packmode;
1554 : char enc_packmode;
1555 : char is_valid_array;
1556 : } __Pyx_BufFmt_Context;
1557 :
1558 : /* Atomics.proto */
1559 : #include <pythread.h>
1560 : #ifndef CYTHON_ATOMICS
1561 : #define CYTHON_ATOMICS 1
1562 : #endif
1563 : #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1564 : #define __pyx_atomic_int_type int
1565 : #define __pyx_nonatomic_int_type int
1566 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1567 : (__STDC_VERSION__ >= 201112L) &&\
1568 : !defined(__STDC_NO_ATOMICS__))
1569 : #include <stdatomic.h>
1570 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1571 : (__cplusplus >= 201103L) ||\
1572 : (defined(_MSC_VER) && _MSC_VER >= 1700)))
1573 : #include <atomic>
1574 : #endif
1575 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1576 : (__STDC_VERSION__ >= 201112L) &&\
1577 : !defined(__STDC_NO_ATOMICS__) &&\
1578 : ATOMIC_INT_LOCK_FREE == 2)
1579 : #undef __pyx_atomic_int_type
1580 : #define __pyx_atomic_int_type atomic_int
1581 : #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1582 : #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1583 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1584 : #pragma message ("Using standard C atomics")
1585 : #elif defined(__PYX_DEBUG_ATOMICS)
1586 : #warning "Using standard C atomics"
1587 : #endif
1588 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1589 : (__cplusplus >= 201103L) ||\
1590 : \
1591 : (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1592 : ATOMIC_INT_LOCK_FREE == 2)
1593 : #undef __pyx_atomic_int_type
1594 : #define __pyx_atomic_int_type std::atomic_int
1595 : #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1596 : #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1597 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1598 : #pragma message ("Using standard C++ atomics")
1599 : #elif defined(__PYX_DEBUG_ATOMICS)
1600 : #warning "Using standard C++ atomics"
1601 : #endif
1602 : #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1603 : (__GNUC_MINOR__ > 1 ||\
1604 : (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1605 : #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1606 : #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1607 : #ifdef __PYX_DEBUG_ATOMICS
1608 : #warning "Using GNU atomics"
1609 : #endif
1610 : #elif CYTHON_ATOMICS && defined(_MSC_VER)
1611 : #include <intrin.h>
1612 : #undef __pyx_atomic_int_type
1613 : #define __pyx_atomic_int_type long
1614 : #undef __pyx_nonatomic_int_type
1615 : #define __pyx_nonatomic_int_type long
1616 : #pragma intrinsic (_InterlockedExchangeAdd)
1617 : #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1618 : #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1619 : #ifdef __PYX_DEBUG_ATOMICS
1620 : #pragma message ("Using MSVC atomics")
1621 : #endif
1622 : #else
1623 : #undef CYTHON_ATOMICS
1624 : #define CYTHON_ATOMICS 0
1625 : #ifdef __PYX_DEBUG_ATOMICS
1626 : #warning "Not using atomics"
1627 : #endif
1628 : #endif
1629 : #if CYTHON_ATOMICS
1630 : #define __pyx_add_acquisition_count(memview)\
1631 : __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1632 : #define __pyx_sub_acquisition_count(memview)\
1633 : __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1634 : #else
1635 : #define __pyx_add_acquisition_count(memview)\
1636 : __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1637 : #define __pyx_sub_acquisition_count(memview)\
1638 : __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1639 : #endif
1640 :
1641 : /* MemviewSliceStruct.proto */
1642 : struct __pyx_memoryview_obj;
1643 : typedef struct {
1644 : struct __pyx_memoryview_obj *memview;
1645 : char *data;
1646 : Py_ssize_t shape[8];
1647 : Py_ssize_t strides[8];
1648 : Py_ssize_t suboffsets[8];
1649 : } __Pyx_memviewslice;
1650 : #define __Pyx_MemoryView_Len(m) (m.shape[0])
1651 :
1652 : /* #### Code section: numeric_typedefs ### */
1653 :
1654 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1655 : * # in Cython to enable them only on the right systems.
1656 : *
1657 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1658 : * ctypedef npy_int16 int16_t
1659 : * ctypedef npy_int32 int32_t
1660 : */
1661 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1662 :
1663 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1664 : *
1665 : * ctypedef npy_int8 int8_t
1666 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1667 : * ctypedef npy_int32 int32_t
1668 : * ctypedef npy_int64 int64_t
1669 : */
1670 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1671 :
1672 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1673 : * ctypedef npy_int8 int8_t
1674 : * ctypedef npy_int16 int16_t
1675 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1676 : * ctypedef npy_int64 int64_t
1677 : * #ctypedef npy_int96 int96_t
1678 : */
1679 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1680 :
1681 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1682 : * ctypedef npy_int16 int16_t
1683 : * ctypedef npy_int32 int32_t
1684 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1685 : * #ctypedef npy_int96 int96_t
1686 : * #ctypedef npy_int128 int128_t
1687 : */
1688 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1689 :
1690 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1691 : * #ctypedef npy_int128 int128_t
1692 : *
1693 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1694 : * ctypedef npy_uint16 uint16_t
1695 : * ctypedef npy_uint32 uint32_t
1696 : */
1697 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1698 :
1699 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1700 : *
1701 : * ctypedef npy_uint8 uint8_t
1702 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1703 : * ctypedef npy_uint32 uint32_t
1704 : * ctypedef npy_uint64 uint64_t
1705 : */
1706 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1707 :
1708 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1709 : * ctypedef npy_uint8 uint8_t
1710 : * ctypedef npy_uint16 uint16_t
1711 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1712 : * ctypedef npy_uint64 uint64_t
1713 : * #ctypedef npy_uint96 uint96_t
1714 : */
1715 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1716 :
1717 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1718 : * ctypedef npy_uint16 uint16_t
1719 : * ctypedef npy_uint32 uint32_t
1720 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1721 : * #ctypedef npy_uint96 uint96_t
1722 : * #ctypedef npy_uint128 uint128_t
1723 : */
1724 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1725 :
1726 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1727 : * #ctypedef npy_uint128 uint128_t
1728 : *
1729 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1730 : * ctypedef npy_float64 float64_t
1731 : * #ctypedef npy_float80 float80_t
1732 : */
1733 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1734 :
1735 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1736 : *
1737 : * ctypedef npy_float32 float32_t
1738 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1739 : * #ctypedef npy_float80 float80_t
1740 : * #ctypedef npy_float128 float128_t
1741 : */
1742 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1743 :
1744 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1745 : * ctypedef double complex complex128_t
1746 : *
1747 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1748 : * ctypedef npy_ulonglong ulonglong_t
1749 : *
1750 : */
1751 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1752 :
1753 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1754 : *
1755 : * ctypedef npy_longlong longlong_t
1756 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1757 : *
1758 : * ctypedef npy_intp intp_t
1759 : */
1760 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1761 :
1762 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1763 : * ctypedef npy_ulonglong ulonglong_t
1764 : *
1765 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1766 : * ctypedef npy_uintp uintp_t
1767 : *
1768 : */
1769 : typedef npy_intp __pyx_t_5numpy_intp_t;
1770 :
1771 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1772 : *
1773 : * ctypedef npy_intp intp_t
1774 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1775 : *
1776 : * ctypedef npy_double float_t
1777 : */
1778 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1779 :
1780 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1781 : * ctypedef npy_uintp uintp_t
1782 : *
1783 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1784 : * ctypedef npy_double double_t
1785 : * ctypedef npy_longdouble longdouble_t
1786 : */
1787 : typedef npy_double __pyx_t_5numpy_float_t;
1788 :
1789 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1790 : *
1791 : * ctypedef npy_double float_t
1792 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1793 : * ctypedef npy_longdouble longdouble_t
1794 : *
1795 : */
1796 : typedef npy_double __pyx_t_5numpy_double_t;
1797 :
1798 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1799 : * ctypedef npy_double float_t
1800 : * ctypedef npy_double double_t
1801 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1802 : *
1803 : * ctypedef float complex cfloat_t
1804 : */
1805 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1806 :
1807 : /* "../scipy/sparse/csgraph/parameters.pxi":3
1808 : *
1809 : * DTYPE = np.float64
1810 : * ctypedef np.float64_t DTYPE_t # <<<<<<<<<<<<<<
1811 : *
1812 : * ITYPE = np.int32
1813 : */
1814 : typedef __pyx_t_5numpy_float64_t __pyx_t_5scipy_6sparse_7csgraph_5_flow_DTYPE_t;
1815 :
1816 : /* "../scipy/sparse/csgraph/parameters.pxi":6
1817 : *
1818 : * ITYPE = np.int32
1819 : * ctypedef np.int32_t ITYPE_t # <<<<<<<<<<<<<<
1820 : *
1821 : * # Fused type for int32 and int64
1822 : */
1823 : typedef __pyx_t_5numpy_int32_t __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t;
1824 : /* #### Code section: complex_type_declarations ### */
1825 : /* Declarations.proto */
1826 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1827 : #ifdef __cplusplus
1828 : typedef ::std::complex< float > __pyx_t_float_complex;
1829 : #else
1830 : typedef float _Complex __pyx_t_float_complex;
1831 : #endif
1832 : #else
1833 : typedef struct { float real, imag; } __pyx_t_float_complex;
1834 : #endif
1835 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1836 :
1837 : /* Declarations.proto */
1838 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1839 : #ifdef __cplusplus
1840 : typedef ::std::complex< double > __pyx_t_double_complex;
1841 : #else
1842 : typedef double _Complex __pyx_t_double_complex;
1843 : #endif
1844 : #else
1845 : typedef struct { double real, imag; } __pyx_t_double_complex;
1846 : #endif
1847 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1848 :
1849 : /* Declarations.proto */
1850 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1851 : #ifdef __cplusplus
1852 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1853 : #else
1854 : typedef long double _Complex __pyx_t_long_double_complex;
1855 : #endif
1856 : #else
1857 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1858 : #endif
1859 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1860 :
1861 : /* #### Code section: type_declarations ### */
1862 :
1863 : /*--- Type declarations ---*/
1864 : struct __pyx_array_obj;
1865 : struct __pyx_MemviewEnum_obj;
1866 : struct __pyx_memoryview_obj;
1867 : struct __pyx_memoryviewslice_obj;
1868 :
1869 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1870 : *
1871 : * # Iterator API added in v1.6
1872 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1873 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1874 : *
1875 : */
1876 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1877 :
1878 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1879 : * # Iterator API added in v1.6
1880 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1881 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1882 : *
1883 : * cdef extern from "numpy/arrayobject.h":
1884 : */
1885 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1886 :
1887 : /* "View.MemoryView":114
1888 : * @cython.collection_type("sequence")
1889 : * @cname("__pyx_array")
1890 : * cdef class array: # <<<<<<<<<<<<<<
1891 : *
1892 : * cdef:
1893 : */
1894 : struct __pyx_array_obj {
1895 : PyObject_HEAD
1896 : struct __pyx_vtabstruct_array *__pyx_vtab;
1897 : char *data;
1898 : Py_ssize_t len;
1899 : char *format;
1900 : int ndim;
1901 : Py_ssize_t *_shape;
1902 : Py_ssize_t *_strides;
1903 : Py_ssize_t itemsize;
1904 : PyObject *mode;
1905 : PyObject *_format;
1906 : void (*callback_free_data)(void *);
1907 : int free_data;
1908 : int dtype_is_object;
1909 : };
1910 :
1911 :
1912 : /* "View.MemoryView":302
1913 : *
1914 : * @cname('__pyx_MemviewEnum')
1915 : * cdef class Enum(object): # <<<<<<<<<<<<<<
1916 : * cdef object name
1917 : * def __init__(self, name):
1918 : */
1919 : struct __pyx_MemviewEnum_obj {
1920 : PyObject_HEAD
1921 : PyObject *name;
1922 : };
1923 :
1924 :
1925 : /* "View.MemoryView":337
1926 : *
1927 : * @cname('__pyx_memoryview')
1928 : * cdef class memoryview: # <<<<<<<<<<<<<<
1929 : *
1930 : * cdef object obj
1931 : */
1932 : struct __pyx_memoryview_obj {
1933 : PyObject_HEAD
1934 : struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1935 : PyObject *obj;
1936 : PyObject *_size;
1937 : PyObject *_array_interface;
1938 : PyThread_type_lock lock;
1939 : __pyx_atomic_int_type acquisition_count;
1940 : Py_buffer view;
1941 : int flags;
1942 : int dtype_is_object;
1943 : __Pyx_TypeInfo *typeinfo;
1944 : };
1945 :
1946 :
1947 : /* "View.MemoryView":952
1948 : * @cython.collection_type("sequence")
1949 : * @cname('__pyx_memoryviewslice')
1950 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1951 : * "Internal class for passing memoryview slices to Python"
1952 : *
1953 : */
1954 : struct __pyx_memoryviewslice_obj {
1955 : struct __pyx_memoryview_obj __pyx_base;
1956 : __Pyx_memviewslice from_slice;
1957 : PyObject *from_object;
1958 : PyObject *(*to_object_func)(char *);
1959 : int (*to_dtype_func)(char *, PyObject *);
1960 : };
1961 :
1962 :
1963 :
1964 : /* "View.MemoryView":114
1965 : * @cython.collection_type("sequence")
1966 : * @cname("__pyx_array")
1967 : * cdef class array: # <<<<<<<<<<<<<<
1968 : *
1969 : * cdef:
1970 : */
1971 :
1972 : struct __pyx_vtabstruct_array {
1973 : PyObject *(*get_memview)(struct __pyx_array_obj *);
1974 : };
1975 : static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1976 :
1977 :
1978 : /* "View.MemoryView":337
1979 : *
1980 : * @cname('__pyx_memoryview')
1981 : * cdef class memoryview: # <<<<<<<<<<<<<<
1982 : *
1983 : * cdef object obj
1984 : */
1985 :
1986 : struct __pyx_vtabstruct_memoryview {
1987 : char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1988 : PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1989 : PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1990 : PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1991 : PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1992 : PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1993 : PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1994 : PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
1995 : };
1996 : static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1997 :
1998 :
1999 : /* "View.MemoryView":952
2000 : * @cython.collection_type("sequence")
2001 : * @cname('__pyx_memoryviewslice')
2002 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
2003 : * "Internal class for passing memoryview slices to Python"
2004 : *
2005 : */
2006 :
2007 : struct __pyx_vtabstruct__memoryviewslice {
2008 : struct __pyx_vtabstruct_memoryview __pyx_base;
2009 : };
2010 : static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2011 : /* #### Code section: utility_code_proto ### */
2012 :
2013 : /* --- Runtime support code (head) --- */
2014 : /* Refnanny.proto */
2015 : #ifndef CYTHON_REFNANNY
2016 : #define CYTHON_REFNANNY 0
2017 : #endif
2018 : #if CYTHON_REFNANNY
2019 : typedef struct {
2020 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
2021 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
2022 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2023 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2024 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2025 : void (*FinishContext)(void**);
2026 : } __Pyx_RefNannyAPIStruct;
2027 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2028 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2029 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2030 : #ifdef WITH_THREAD
2031 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2032 : if (acquire_gil) {\
2033 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2034 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2035 : PyGILState_Release(__pyx_gilstate_save);\
2036 : } else {\
2037 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2038 : }
2039 : #define __Pyx_RefNannyFinishContextNogil() {\
2040 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2041 : __Pyx_RefNannyFinishContext();\
2042 : PyGILState_Release(__pyx_gilstate_save);\
2043 : }
2044 : #else
2045 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2046 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2047 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2048 : #endif
2049 : #define __Pyx_RefNannyFinishContextNogil() {\
2050 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2051 : __Pyx_RefNannyFinishContext();\
2052 : PyGILState_Release(__pyx_gilstate_save);\
2053 : }
2054 : #define __Pyx_RefNannyFinishContext()\
2055 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2056 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2057 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2058 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2059 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2060 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2061 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2062 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2063 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2064 : #else
2065 : #define __Pyx_RefNannyDeclarations
2066 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
2067 : #define __Pyx_RefNannyFinishContextNogil()
2068 : #define __Pyx_RefNannyFinishContext()
2069 : #define __Pyx_INCREF(r) Py_INCREF(r)
2070 : #define __Pyx_DECREF(r) Py_DECREF(r)
2071 : #define __Pyx_GOTREF(r)
2072 : #define __Pyx_GIVEREF(r)
2073 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
2074 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
2075 : #define __Pyx_XGOTREF(r)
2076 : #define __Pyx_XGIVEREF(r)
2077 : #endif
2078 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
2079 : PyObject *tmp = (PyObject *) r;\
2080 : r = v; Py_XDECREF(tmp);\
2081 : } while (0)
2082 : #define __Pyx_XDECREF_SET(r, v) do {\
2083 : PyObject *tmp = (PyObject *) r;\
2084 : r = v; __Pyx_XDECREF(tmp);\
2085 : } while (0)
2086 : #define __Pyx_DECREF_SET(r, v) do {\
2087 : PyObject *tmp = (PyObject *) r;\
2088 : r = v; __Pyx_DECREF(tmp);\
2089 : } while (0)
2090 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2091 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2092 :
2093 : /* PyErrExceptionMatches.proto */
2094 : #if CYTHON_FAST_THREAD_STATE
2095 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2096 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2097 : #else
2098 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2099 : #endif
2100 :
2101 : /* PyThreadStateGet.proto */
2102 : #if CYTHON_FAST_THREAD_STATE
2103 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2104 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2105 : #if PY_VERSION_HEX >= 0x030C00A6
2106 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2107 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2108 : #else
2109 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2110 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2111 : #endif
2112 : #else
2113 : #define __Pyx_PyThreadState_declare
2114 : #define __Pyx_PyThreadState_assign
2115 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2116 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2117 : #endif
2118 :
2119 : /* PyErrFetchRestore.proto */
2120 : #if CYTHON_FAST_THREAD_STATE
2121 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2122 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2123 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2124 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2125 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2126 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2127 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2128 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2129 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2130 : #else
2131 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2132 : #endif
2133 : #else
2134 : #define __Pyx_PyErr_Clear() PyErr_Clear()
2135 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2136 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2137 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2138 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2139 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2140 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2141 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2142 : #endif
2143 :
2144 : /* PyObjectGetAttrStr.proto */
2145 : #if CYTHON_USE_TYPE_SLOTS
2146 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2147 : #else
2148 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2149 : #endif
2150 :
2151 : /* PyObjectGetAttrStrNoError.proto */
2152 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2153 :
2154 : /* GetBuiltinName.proto */
2155 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2156 :
2157 : /* TupleAndListFromArray.proto */
2158 : #if CYTHON_COMPILING_IN_CPYTHON
2159 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2160 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2161 : #endif
2162 :
2163 : /* IncludeStringH.proto */
2164 : #include <string.h>
2165 :
2166 : /* BytesEquals.proto */
2167 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2168 :
2169 : /* UnicodeEquals.proto */
2170 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2171 :
2172 : /* fastcall.proto */
2173 : #if CYTHON_AVOID_BORROWED_REFS
2174 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2175 : #elif CYTHON_ASSUME_SAFE_MACROS
2176 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2177 : #else
2178 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2179 : #endif
2180 : #if CYTHON_AVOID_BORROWED_REFS
2181 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2182 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2183 : #else
2184 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2185 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2186 : #endif
2187 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2188 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2189 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2190 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2191 : #if CYTHON_METH_FASTCALL
2192 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2193 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2194 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2195 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2196 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2197 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2198 : #else
2199 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2200 : #endif
2201 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2202 : to have the same reference counting */
2203 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2204 : #else
2205 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2206 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2207 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2208 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2209 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2210 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2211 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2212 : #endif
2213 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2214 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2215 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2216 : #else
2217 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2218 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2219 : #endif
2220 :
2221 : /* RaiseArgTupleInvalid.proto */
2222 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2223 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2224 :
2225 : /* RaiseDoubleKeywords.proto */
2226 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2227 :
2228 : /* ParseKeywords.proto */
2229 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2230 : PyObject **argnames[],
2231 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2232 : const char* function_name);
2233 :
2234 : /* ArgTypeTest.proto */
2235 : #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2236 : ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2237 : __Pyx__ArgTypeTest(obj, type, name, exact))
2238 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2239 :
2240 : /* RaiseException.proto */
2241 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2242 :
2243 : /* PyFunctionFastCall.proto */
2244 : #if CYTHON_FAST_PYCALL
2245 : #if !CYTHON_VECTORCALL
2246 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2247 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2248 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2249 : #endif
2250 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2251 : (sizeof(char [1 - 2*!(cond)]) - 1)
2252 : #ifndef Py_MEMBER_SIZE
2253 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2254 : #endif
2255 : #if !CYTHON_VECTORCALL
2256 : #if PY_VERSION_HEX >= 0x03080000
2257 : #include "frameobject.h"
2258 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2259 : #ifndef Py_BUILD_CORE
2260 : #define Py_BUILD_CORE 1
2261 : #endif
2262 : #include "internal/pycore_frame.h"
2263 : #endif
2264 : #define __Pxy_PyFrame_Initialize_Offsets()
2265 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2266 : #else
2267 : static size_t __pyx_pyframe_localsplus_offset = 0;
2268 : #include "frameobject.h"
2269 : #define __Pxy_PyFrame_Initialize_Offsets()\
2270 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2271 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2272 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2273 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2274 : #endif
2275 : #endif
2276 : #endif
2277 :
2278 : /* PyObjectCall.proto */
2279 : #if CYTHON_COMPILING_IN_CPYTHON
2280 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2281 : #else
2282 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2283 : #endif
2284 :
2285 : /* PyObjectCallMethO.proto */
2286 : #if CYTHON_COMPILING_IN_CPYTHON
2287 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2288 : #endif
2289 :
2290 : /* PyObjectFastCall.proto */
2291 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2292 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2293 :
2294 : /* RaiseUnexpectedTypeError.proto */
2295 : static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2296 :
2297 : /* GCCDiagnostics.proto */
2298 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2299 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2300 : #endif
2301 :
2302 : /* BuildPyUnicode.proto */
2303 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
2304 : int prepend_sign, char padding_char);
2305 :
2306 : /* CIntToPyUnicode.proto */
2307 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2308 :
2309 : /* CIntToPyUnicode.proto */
2310 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2311 :
2312 : /* JoinPyUnicode.proto */
2313 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2314 : Py_UCS4 max_char);
2315 :
2316 : /* StrEquals.proto */
2317 : #if PY_MAJOR_VERSION >= 3
2318 : #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2319 : #else
2320 : #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2321 : #endif
2322 :
2323 : /* PyObjectFormatSimple.proto */
2324 : #if CYTHON_COMPILING_IN_PYPY
2325 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2326 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2327 : PyObject_Format(s, f))
2328 : #elif PY_MAJOR_VERSION < 3
2329 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2330 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2331 : likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2332 : PyObject_Format(s, f))
2333 : #elif CYTHON_USE_TYPE_SLOTS
2334 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2335 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2336 : likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2337 : likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2338 : PyObject_Format(s, f))
2339 : #else
2340 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2341 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2342 : PyObject_Format(s, f))
2343 : #endif
2344 :
2345 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2346 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2347 : /* GetAttr.proto */
2348 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2349 :
2350 : /* GetItemInt.proto */
2351 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2352 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2353 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2354 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2355 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2356 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2357 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2358 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2359 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2360 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2361 : int wraparound, int boundscheck);
2362 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2363 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2364 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2365 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2366 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2367 : int wraparound, int boundscheck);
2368 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2369 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2370 : int is_list, int wraparound, int boundscheck);
2371 :
2372 : /* PyObjectCallOneArg.proto */
2373 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2374 :
2375 : /* ObjectGetItem.proto */
2376 : #if CYTHON_USE_TYPE_SLOTS
2377 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2378 : #else
2379 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2380 : #endif
2381 :
2382 : /* KeywordStringCheck.proto */
2383 : static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2384 :
2385 : /* DivInt[Py_ssize_t].proto */
2386 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2387 :
2388 : /* UnaryNegOverflows.proto */
2389 : #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2390 : (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2391 :
2392 : /* GetAttr3.proto */
2393 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2394 :
2395 : /* PyDictVersioning.proto */
2396 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2397 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2398 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2399 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2400 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2401 : (cache_var) = (value);
2402 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2403 : static PY_UINT64_T __pyx_dict_version = 0;\
2404 : static PyObject *__pyx_dict_cached_value = NULL;\
2405 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2406 : (VAR) = __pyx_dict_cached_value;\
2407 : } else {\
2408 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2409 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2410 : }\
2411 : }
2412 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2413 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2414 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2415 : #else
2416 : #define __PYX_GET_DICT_VERSION(dict) (0)
2417 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2418 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2419 : #endif
2420 :
2421 : /* GetModuleGlobalName.proto */
2422 : #if CYTHON_USE_DICT_VERSIONS
2423 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2424 : static PY_UINT64_T __pyx_dict_version = 0;\
2425 : static PyObject *__pyx_dict_cached_value = NULL;\
2426 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2427 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2428 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2429 : } while(0)
2430 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2431 : PY_UINT64_T __pyx_dict_version;\
2432 : PyObject *__pyx_dict_cached_value;\
2433 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2434 : } while(0)
2435 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2436 : #else
2437 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2438 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2439 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2440 : #endif
2441 :
2442 : /* AssertionsEnabled.proto */
2443 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2444 : #define __Pyx_init_assertions_enabled() (0)
2445 : #define __pyx_assertions_enabled() (1)
2446 : #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
2447 : static int __pyx_assertions_enabled_flag;
2448 : #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2449 3 : static int __Pyx_init_assertions_enabled(void) {
2450 3 : PyObject *builtins, *debug, *debug_str;
2451 3 : int flag;
2452 3 : builtins = PyEval_GetBuiltins();
2453 3 : if (!builtins) goto bad;
2454 3 : debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2455 3 : if (!debug_str) goto bad;
2456 3 : debug = PyObject_GetItem(builtins, debug_str);
2457 3 : Py_DECREF(debug_str);
2458 3 : if (!debug) goto bad;
2459 3 : flag = PyObject_IsTrue(debug);
2460 3 : Py_DECREF(debug);
2461 3 : if (flag == -1) goto bad;
2462 3 : __pyx_assertions_enabled_flag = flag;
2463 3 : return 0;
2464 0 : bad:
2465 0 : __pyx_assertions_enabled_flag = 1;
2466 0 : return -1;
2467 : }
2468 : #else
2469 : #define __Pyx_init_assertions_enabled() (0)
2470 : #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2471 : #endif
2472 :
2473 : /* RaiseTooManyValuesToUnpack.proto */
2474 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2475 :
2476 : /* RaiseNeedMoreValuesToUnpack.proto */
2477 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2478 :
2479 : /* RaiseNoneIterError.proto */
2480 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2481 :
2482 : /* ExtTypeTest.proto */
2483 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2484 :
2485 : /* GetTopmostException.proto */
2486 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2487 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2488 : #endif
2489 :
2490 : /* SaveResetException.proto */
2491 : #if CYTHON_FAST_THREAD_STATE
2492 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2493 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2494 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2495 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2496 : #else
2497 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2498 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2499 : #endif
2500 :
2501 : /* GetException.proto */
2502 : #if CYTHON_FAST_THREAD_STATE
2503 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2504 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2505 : #else
2506 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2507 : #endif
2508 :
2509 : /* SwapException.proto */
2510 : #if CYTHON_FAST_THREAD_STATE
2511 : #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2512 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2513 : #else
2514 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2515 : #endif
2516 :
2517 : /* Import.proto */
2518 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2519 :
2520 : /* ImportDottedModule.proto */
2521 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2522 : #if PY_MAJOR_VERSION >= 3
2523 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2524 : #endif
2525 :
2526 : /* FastTypeChecks.proto */
2527 : #if CYTHON_COMPILING_IN_CPYTHON
2528 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2529 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2530 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2531 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2532 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2533 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2534 : #else
2535 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2536 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2537 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2538 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2539 : #endif
2540 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2541 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2542 :
2543 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2544 : /* ListCompAppend.proto */
2545 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2546 0 : static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2547 0 : PyListObject* L = (PyListObject*) list;
2548 0 : Py_ssize_t len = Py_SIZE(list);
2549 0 : if (likely(L->allocated > len)) {
2550 0 : Py_INCREF(x);
2551 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2552 : L->ob_item[len] = x;
2553 : #else
2554 0 : PyList_SET_ITEM(list, len, x);
2555 : #endif
2556 0 : __Pyx_SET_SIZE(list, len + 1);
2557 0 : return 0;
2558 : }
2559 0 : return PyList_Append(list, x);
2560 : }
2561 : #else
2562 : #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2563 : #endif
2564 :
2565 : /* PySequenceMultiply.proto */
2566 : #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2567 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2568 :
2569 : /* SetItemInt.proto */
2570 : #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2571 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2572 : __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2573 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2574 : __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2575 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2576 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2577 : int is_list, int wraparound, int boundscheck);
2578 :
2579 : /* RaiseUnboundLocalError.proto */
2580 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2581 :
2582 : /* DivInt[long].proto */
2583 : static CYTHON_INLINE long __Pyx_div_long(long, long);
2584 :
2585 : /* PySequenceContains.proto */
2586 0 : static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2587 0 : int result = PySequence_Contains(seq, item);
2588 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2589 : }
2590 :
2591 : /* ImportFrom.proto */
2592 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2593 :
2594 : /* HasAttr.proto */
2595 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2596 :
2597 : /* PyObjectSetAttrStr.proto */
2598 : #if CYTHON_USE_TYPE_SLOTS
2599 : #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
2600 : static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
2601 : #else
2602 : #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
2603 : #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
2604 : #endif
2605 :
2606 : /* PyIntBinop.proto */
2607 : #if !CYTHON_COMPILING_IN_PYPY
2608 : static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2609 : #else
2610 : #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
2611 : (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2612 : #endif
2613 :
2614 : /* IterFinish.proto */
2615 : static CYTHON_INLINE int __Pyx_IterFinish(void);
2616 :
2617 : /* UnpackItemEndCheck.proto */
2618 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2619 :
2620 : /* PyIntBinop.proto */
2621 : #if !CYTHON_COMPILING_IN_PYPY
2622 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2623 : #else
2624 : #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2625 : (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2626 : #endif
2627 :
2628 : /* SliceObject.proto */
2629 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2630 : PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2631 : PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2632 : int has_cstart, int has_cstop, int wraparound);
2633 :
2634 : /* PyIntBinop.proto */
2635 : #if !CYTHON_COMPILING_IN_PYPY
2636 : static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2637 : #else
2638 : #define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\
2639 : (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
2640 : #endif
2641 :
2642 : /* PyObject_GenericGetAttrNoDict.proto */
2643 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2644 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2645 : #else
2646 : #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2647 : #endif
2648 :
2649 : /* PyObject_GenericGetAttr.proto */
2650 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2651 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2652 : #else
2653 : #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2654 : #endif
2655 :
2656 : /* IncludeStructmemberH.proto */
2657 : #include <structmember.h>
2658 :
2659 : /* FixUpExtensionType.proto */
2660 : #if CYTHON_USE_TYPE_SPECS
2661 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2662 : #endif
2663 :
2664 : /* PyObjectCallNoArg.proto */
2665 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2666 :
2667 : /* PyObjectGetMethod.proto */
2668 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2669 :
2670 : /* PyObjectCallMethod0.proto */
2671 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2672 :
2673 : /* ValidateBasesTuple.proto */
2674 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2675 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
2676 : #endif
2677 :
2678 : /* PyType_Ready.proto */
2679 : CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2680 :
2681 : /* SetVTable.proto */
2682 : static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
2683 :
2684 : /* GetVTable.proto */
2685 : static void* __Pyx_GetVtable(PyTypeObject *type);
2686 :
2687 : /* MergeVTables.proto */
2688 : #if !CYTHON_COMPILING_IN_LIMITED_API
2689 : static int __Pyx_MergeVtables(PyTypeObject *type);
2690 : #endif
2691 :
2692 : /* SetupReduce.proto */
2693 : #if !CYTHON_COMPILING_IN_LIMITED_API
2694 : static int __Pyx_setup_reduce(PyObject* type_obj);
2695 : #endif
2696 :
2697 : /* TypeImport.proto */
2698 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2699 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2700 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2701 : #include <stdalign.h>
2702 : #endif
2703 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2704 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2705 : #else
2706 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2707 : #endif
2708 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2709 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2710 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2711 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2712 : };
2713 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2714 : #endif
2715 :
2716 : /* FetchSharedCythonModule.proto */
2717 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2718 :
2719 : /* FetchCommonType.proto */
2720 : #if !CYTHON_USE_TYPE_SPECS
2721 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2722 : #else
2723 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2724 : #endif
2725 :
2726 : /* PyMethodNew.proto */
2727 : #if CYTHON_COMPILING_IN_LIMITED_API
2728 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2729 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2730 : CYTHON_UNUSED_VAR(typ);
2731 : if (!self)
2732 : return __Pyx_NewRef(func);
2733 : typesModule = PyImport_ImportModule("types");
2734 : if (!typesModule) return NULL;
2735 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2736 : Py_DECREF(typesModule);
2737 : if (!methodType) return NULL;
2738 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2739 : Py_DECREF(methodType);
2740 : return result;
2741 : }
2742 : #elif PY_MAJOR_VERSION >= 3
2743 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2744 0 : CYTHON_UNUSED_VAR(typ);
2745 0 : if (!self)
2746 0 : return __Pyx_NewRef(func);
2747 0 : return PyMethod_New(func, self);
2748 : }
2749 : #else
2750 : #define __Pyx_PyMethod_New PyMethod_New
2751 : #endif
2752 :
2753 : /* PyVectorcallFastCallDict.proto */
2754 : #if CYTHON_METH_FASTCALL
2755 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2756 : #endif
2757 :
2758 : /* CythonFunctionShared.proto */
2759 : #define __Pyx_CyFunction_USED
2760 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2761 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2762 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2763 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2764 : #define __Pyx_CyFunction_GetClosure(f)\
2765 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2766 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2767 : #define __Pyx_CyFunction_GetClassObj(f)\
2768 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2769 : #else
2770 : #define __Pyx_CyFunction_GetClassObj(f)\
2771 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2772 : #endif
2773 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2774 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2775 : #define __Pyx_CyFunction_Defaults(type, f)\
2776 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2777 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2778 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2779 : typedef struct {
2780 : #if CYTHON_COMPILING_IN_LIMITED_API
2781 : PyObject_HEAD
2782 : PyObject *func;
2783 : #elif PY_VERSION_HEX < 0x030900B1
2784 : PyCFunctionObject func;
2785 : #else
2786 : PyCMethodObject func;
2787 : #endif
2788 : #if CYTHON_BACKPORT_VECTORCALL
2789 : __pyx_vectorcallfunc func_vectorcall;
2790 : #endif
2791 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2792 : PyObject *func_weakreflist;
2793 : #endif
2794 : PyObject *func_dict;
2795 : PyObject *func_name;
2796 : PyObject *func_qualname;
2797 : PyObject *func_doc;
2798 : PyObject *func_globals;
2799 : PyObject *func_code;
2800 : PyObject *func_closure;
2801 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2802 : PyObject *func_classobj;
2803 : #endif
2804 : void *defaults;
2805 : int defaults_pyobjects;
2806 : size_t defaults_size;
2807 : int flags;
2808 : PyObject *defaults_tuple;
2809 : PyObject *defaults_kwdict;
2810 : PyObject *(*defaults_getter)(PyObject *);
2811 : PyObject *func_annotations;
2812 : PyObject *func_is_coroutine;
2813 : } __pyx_CyFunctionObject;
2814 : #undef __Pyx_CyOrPyCFunction_Check
2815 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2816 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2817 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2818 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2819 : #undef __Pyx_IsSameCFunction
2820 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2821 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2822 : int flags, PyObject* qualname,
2823 : PyObject *closure,
2824 : PyObject *module, PyObject *globals,
2825 : PyObject* code);
2826 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2827 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2828 : size_t size,
2829 : int pyobjects);
2830 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2831 : PyObject *tuple);
2832 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2833 : PyObject *dict);
2834 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2835 : PyObject *dict);
2836 : static int __pyx_CyFunction_init(PyObject *module);
2837 : #if CYTHON_METH_FASTCALL
2838 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2839 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2840 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2841 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2842 : #if CYTHON_BACKPORT_VECTORCALL
2843 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
2844 : #else
2845 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2846 : #endif
2847 : #endif
2848 :
2849 : /* CythonFunction.proto */
2850 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2851 : int flags, PyObject* qualname,
2852 : PyObject *closure,
2853 : PyObject *module, PyObject *globals,
2854 : PyObject* code);
2855 :
2856 : /* SetNameInClass.proto */
2857 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
2858 : #define __Pyx_SetNameInClass(ns, name, value)\
2859 : (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2860 : #elif CYTHON_COMPILING_IN_CPYTHON
2861 : #define __Pyx_SetNameInClass(ns, name, value)\
2862 : (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2863 : #else
2864 : #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2865 : #endif
2866 :
2867 : /* CalculateMetaclass.proto */
2868 : static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2869 :
2870 : /* PyObjectCall2Args.proto */
2871 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2872 :
2873 : /* PyObjectLookupSpecial.proto */
2874 : #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2875 : #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
2876 : #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
2877 : static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
2878 : #else
2879 : #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
2880 : #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
2881 : #endif
2882 :
2883 : /* Py3ClassCreate.proto */
2884 : static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2885 : PyObject *mkw, PyObject *modname, PyObject *doc);
2886 : static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2887 : PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2888 :
2889 : /* CLineInTraceback.proto */
2890 : #ifdef CYTHON_CLINE_IN_TRACEBACK
2891 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2892 : #else
2893 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2894 : #endif
2895 :
2896 : /* CodeObjectCache.proto */
2897 : #if !CYTHON_COMPILING_IN_LIMITED_API
2898 : typedef struct {
2899 : PyCodeObject* code_object;
2900 : int code_line;
2901 : } __Pyx_CodeObjectCacheEntry;
2902 : struct __Pyx_CodeObjectCache {
2903 : int count;
2904 : int max_count;
2905 : __Pyx_CodeObjectCacheEntry* entries;
2906 : };
2907 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2908 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2909 : static PyCodeObject *__pyx_find_code_object(int code_line);
2910 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2911 : #endif
2912 :
2913 : /* AddTraceback.proto */
2914 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
2915 : int py_line, const char *filename);
2916 :
2917 : #if PY_MAJOR_VERSION < 3
2918 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2919 : static void __Pyx_ReleaseBuffer(Py_buffer *view);
2920 : #else
2921 : #define __Pyx_GetBuffer PyObject_GetBuffer
2922 : #define __Pyx_ReleaseBuffer PyBuffer_Release
2923 : #endif
2924 :
2925 :
2926 : /* BufferStructDeclare.proto */
2927 : typedef struct {
2928 : Py_ssize_t shape, strides, suboffsets;
2929 : } __Pyx_Buf_DimInfo;
2930 : typedef struct {
2931 : size_t refcount;
2932 : Py_buffer pybuffer;
2933 : } __Pyx_Buffer;
2934 : typedef struct {
2935 : __Pyx_Buffer *rcbuffer;
2936 : char *data;
2937 : __Pyx_Buf_DimInfo diminfo[8];
2938 : } __Pyx_LocalBuf_ND;
2939 :
2940 : /* MemviewSliceIsContig.proto */
2941 : static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2942 :
2943 : /* OverlappingSlices.proto */
2944 : static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2945 : __Pyx_memviewslice *slice2,
2946 : int ndim, size_t itemsize);
2947 :
2948 : /* IsLittleEndian.proto */
2949 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2950 :
2951 : /* BufferFormatCheck.proto */
2952 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2953 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2954 : __Pyx_BufFmt_StackElem* stack,
2955 : __Pyx_TypeInfo* type);
2956 :
2957 : /* TypeInfoCompare.proto */
2958 : static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2959 :
2960 : /* MemviewSliceValidateAndInit.proto */
2961 : static int __Pyx_ValidateAndInit_memviewslice(
2962 : int *axes_specs,
2963 : int c_or_f_flag,
2964 : int buf_flags,
2965 : int ndim,
2966 : __Pyx_TypeInfo *dtype,
2967 : __Pyx_BufFmt_StackElem stack[],
2968 : __Pyx_memviewslice *memviewslice,
2969 : PyObject *original_obj);
2970 :
2971 : /* ObjectToMemviewSlice.proto */
2972 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(PyObject *, int writable_flag);
2973 :
2974 : /* ObjectToMemviewSlice.proto */
2975 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(PyObject *, int writable_flag);
2976 :
2977 : /* MemviewDtypeToObject.proto */
2978 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(const char *itemp);
2979 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(const char *itemp, PyObject *obj);
2980 :
2981 : /* ObjectToMemviewSlice.proto */
2982 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(PyObject *, int writable_flag);
2983 :
2984 : /* RealImag.proto */
2985 : #if CYTHON_CCOMPLEX
2986 : #ifdef __cplusplus
2987 : #define __Pyx_CREAL(z) ((z).real())
2988 : #define __Pyx_CIMAG(z) ((z).imag())
2989 : #else
2990 : #define __Pyx_CREAL(z) (__real__(z))
2991 : #define __Pyx_CIMAG(z) (__imag__(z))
2992 : #endif
2993 : #else
2994 : #define __Pyx_CREAL(z) ((z).real)
2995 : #define __Pyx_CIMAG(z) ((z).imag)
2996 : #endif
2997 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2998 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2999 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3000 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3001 : #else
3002 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3003 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3004 : #endif
3005 :
3006 : /* Arithmetic.proto */
3007 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3008 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
3009 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
3010 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
3011 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
3012 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
3013 : #define __Pyx_c_neg_float(a) (-(a))
3014 : #ifdef __cplusplus
3015 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3016 : #define __Pyx_c_conj_float(z) (::std::conj(z))
3017 : #if 1
3018 : #define __Pyx_c_abs_float(z) (::std::abs(z))
3019 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3020 : #endif
3021 : #else
3022 : #define __Pyx_c_is_zero_float(z) ((z)==0)
3023 : #define __Pyx_c_conj_float(z) (conjf(z))
3024 : #if 1
3025 : #define __Pyx_c_abs_float(z) (cabsf(z))
3026 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3027 : #endif
3028 : #endif
3029 : #else
3030 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3031 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3032 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3033 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3034 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3035 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3036 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3037 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3038 : #if 1
3039 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3040 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3041 : #endif
3042 : #endif
3043 :
3044 : /* Arithmetic.proto */
3045 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3046 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
3047 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
3048 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
3049 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
3050 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
3051 : #define __Pyx_c_neg_double(a) (-(a))
3052 : #ifdef __cplusplus
3053 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3054 : #define __Pyx_c_conj_double(z) (::std::conj(z))
3055 : #if 1
3056 : #define __Pyx_c_abs_double(z) (::std::abs(z))
3057 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3058 : #endif
3059 : #else
3060 : #define __Pyx_c_is_zero_double(z) ((z)==0)
3061 : #define __Pyx_c_conj_double(z) (conj(z))
3062 : #if 1
3063 : #define __Pyx_c_abs_double(z) (cabs(z))
3064 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3065 : #endif
3066 : #endif
3067 : #else
3068 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3069 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3070 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3071 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3072 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3073 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3074 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3075 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3076 : #if 1
3077 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3078 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3079 : #endif
3080 : #endif
3081 :
3082 : /* Arithmetic.proto */
3083 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3084 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3085 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3086 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3087 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3088 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3089 : #define __Pyx_c_neg_long__double(a) (-(a))
3090 : #ifdef __cplusplus
3091 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3092 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3093 : #if 1
3094 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3095 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3096 : #endif
3097 : #else
3098 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3099 : #define __Pyx_c_conj_long__double(z) (conjl(z))
3100 : #if 1
3101 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
3102 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3103 : #endif
3104 : #endif
3105 : #else
3106 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3107 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3108 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3109 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3110 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3111 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3112 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3113 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3114 : #if 1
3115 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3116 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3117 : #endif
3118 : #endif
3119 :
3120 : /* MemviewSliceCopyTemplate.proto */
3121 : static __Pyx_memviewslice
3122 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3123 : const char *mode, int ndim,
3124 : size_t sizeof_dtype, int contig_flag,
3125 : int dtype_is_object);
3126 :
3127 : /* MemviewSliceInit.proto */
3128 : #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3129 : #define __Pyx_MEMVIEW_DIRECT 1
3130 : #define __Pyx_MEMVIEW_PTR 2
3131 : #define __Pyx_MEMVIEW_FULL 4
3132 : #define __Pyx_MEMVIEW_CONTIG 8
3133 : #define __Pyx_MEMVIEW_STRIDED 16
3134 : #define __Pyx_MEMVIEW_FOLLOW 32
3135 : #define __Pyx_IS_C_CONTIG 1
3136 : #define __Pyx_IS_F_CONTIG 2
3137 : static int __Pyx_init_memviewslice(
3138 : struct __pyx_memoryview_obj *memview,
3139 : int ndim,
3140 : __Pyx_memviewslice *memviewslice,
3141 : int memview_is_new_reference);
3142 : static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3143 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3144 : static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3145 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3146 : #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3147 : #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3148 : #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3149 : static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3150 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3151 :
3152 : /* CIntToPy.proto */
3153 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3154 :
3155 : /* CIntFromPy.proto */
3156 : static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
3157 :
3158 : /* CIntToPy.proto */
3159 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
3160 :
3161 : /* CIntFromPy.proto */
3162 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3163 :
3164 : /* CIntToPy.proto */
3165 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3166 :
3167 : /* CIntFromPy.proto */
3168 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3169 :
3170 : /* CIntFromPy.proto */
3171 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3172 :
3173 : /* FormatTypeName.proto */
3174 : #if CYTHON_COMPILING_IN_LIMITED_API
3175 : typedef PyObject *__Pyx_TypeName;
3176 : #define __Pyx_FMT_TYPENAME "%U"
3177 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3178 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3179 : #else
3180 : typedef const char *__Pyx_TypeName;
3181 : #define __Pyx_FMT_TYPENAME "%.200s"
3182 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3183 : #define __Pyx_DECREF_TypeName(obj)
3184 : #endif
3185 :
3186 : /* CheckBinaryVersion.proto */
3187 : static unsigned long __Pyx_get_runtime_version(void);
3188 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3189 :
3190 : /* InitStrings.proto */
3191 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3192 :
3193 : /* #### Code section: module_declarations ### */
3194 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3195 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3196 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3197 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3198 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3199 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3200 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3201 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3202 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3203 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3204 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3205 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3206 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
3207 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
3208 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
3209 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
3210 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
3211 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
3212 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3213 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3214 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3215 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3216 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3217 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3218 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
3219 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
3220 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
3221 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
3222 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
3223 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3224 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3225 :
3226 : /* Module declarations from "libc.string" */
3227 :
3228 : /* Module declarations from "libc.stdio" */
3229 :
3230 : /* Module declarations from "__builtin__" */
3231 :
3232 : /* Module declarations from "cpython.type" */
3233 :
3234 : /* Module declarations from "cpython" */
3235 :
3236 : /* Module declarations from "cpython.object" */
3237 :
3238 : /* Module declarations from "cpython.ref" */
3239 :
3240 : /* Module declarations from "numpy" */
3241 :
3242 : /* Module declarations from "numpy" */
3243 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
3244 :
3245 : /* Module declarations from "scipy.sparse.csgraph._flow" */
3246 : static PyObject *__pyx_collections_abc_Sequence = 0;
3247 : static PyObject *generic = 0;
3248 : static PyObject *strided = 0;
3249 : static PyObject *indirect = 0;
3250 : static PyObject *contiguous = 0;
3251 : static PyObject *indirect_contiguous = 0;
3252 : static int __pyx_memoryview_thread_locks_used;
3253 : static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3254 : static __Pyx_memviewslice __pyx_f_5scipy_6sparse_7csgraph_5_flow__edmonds_karp(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const , __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const ); /*proto*/
3255 : static int __pyx_f_5scipy_6sparse_7csgraph_5_flow__build_level_graph(__Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const , __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
3256 : static int __pyx_f_5scipy_6sparse_7csgraph_5_flow__augment_paths(__Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const , __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const , __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
3257 : static __Pyx_memviewslice __pyx_f_5scipy_6sparse_7csgraph_5_flow__dinic(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const , __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const ); /*proto*/
3258 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3259 : static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3260 : static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3261 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3262 : static PyObject *_unellipsify(PyObject *, int); /*proto*/
3263 : static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3264 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3265 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3266 : static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3267 : static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3268 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3269 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3270 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3271 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3272 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3273 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3274 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3275 : static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3276 : static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3277 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3278 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3279 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3280 : static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3281 : static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
3282 : static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
3283 : static int __pyx_memoryview_err_no_memory(void); /*proto*/
3284 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3285 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3286 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3287 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3288 : static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3289 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3290 : static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3291 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3292 : /* #### Code section: typeinfo ### */
3293 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__ = { "const ITYPE_t", NULL, sizeof(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const ), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const ) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const ), 0 };
3294 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t = { "ITYPE_t", NULL, sizeof(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t), 0 };
3295 : /* #### Code section: before_global_var ### */
3296 : #define __Pyx_MODULE_NAME "scipy.sparse.csgraph._flow"
3297 : extern int __pyx_module_is_main_scipy__sparse__csgraph___flow;
3298 : int __pyx_module_is_main_scipy__sparse__csgraph___flow = 0;
3299 :
3300 : /* Implementation of "scipy.sparse.csgraph._flow" */
3301 : /* #### Code section: global_var ### */
3302 : static PyObject *__pyx_builtin_TypeError;
3303 : static PyObject *__pyx_builtin_ValueError;
3304 : static PyObject *__pyx_builtin_range;
3305 : static PyObject *__pyx_builtin___import__;
3306 : static PyObject *__pyx_builtin_MemoryError;
3307 : static PyObject *__pyx_builtin_enumerate;
3308 : static PyObject *__pyx_builtin_AssertionError;
3309 : static PyObject *__pyx_builtin_Ellipsis;
3310 : static PyObject *__pyx_builtin_id;
3311 : static PyObject *__pyx_builtin_IndexError;
3312 : static PyObject *__pyx_builtin_ImportError;
3313 : /* #### Code section: string_decls ### */
3314 : static const char __pyx_k_[] = ": ";
3315 : static const char __pyx_k_O[] = "O";
3316 : static const char __pyx_k_a[] = "a";
3317 : static const char __pyx_k_b[] = "b";
3318 : static const char __pyx_k_c[] = "c";
3319 : static const char __pyx_k_i[] = "i";
3320 : static const char __pyx_k_j[] = "j";
3321 : static const char __pyx_k_m[] = "m";
3322 : static const char __pyx_k_n[] = "n";
3323 : static const char __pyx_k__2[] = ".";
3324 : static const char __pyx_k__3[] = "*";
3325 : static const char __pyx_k__6[] = "'";
3326 : static const char __pyx_k__7[] = ")";
3327 : static const char __pyx_k_at[] = "at";
3328 : static const char __pyx_k_gc[] = "gc";
3329 : static const char __pyx_k_id[] = "id";
3330 : static const char __pyx_k_np[] = "np";
3331 : static const char __pyx_k__38[] = "?";
3332 : static const char __pyx_k_abc[] = "abc";
3333 : static const char __pyx_k_and[] = " and ";
3334 : static const char __pyx_k_csr[] = "csr";
3335 : static const char __pyx_k_doc[] = "__doc__";
3336 : static const char __pyx_k_got[] = " (got ";
3337 : static const char __pyx_k_max[] = "max";
3338 : static const char __pyx_k_new[] = "__new__";
3339 : static const char __pyx_k_nnz[] = "nnz";
3340 : static const char __pyx_k_obj[] = "obj";
3341 : static const char __pyx_k_sum[] = "sum";
3342 : static const char __pyx_k_sys[] = "sys";
3343 : static const char __pyx_k_base[] = "base";
3344 : static const char __pyx_k_data[] = "data";
3345 : static const char __pyx_k_dict[] = "__dict__";
3346 : static const char __pyx_k_flow[] = "flow";
3347 : static const char __pyx_k_init[] = "__init__";
3348 : static const char __pyx_k_main[] = "__main__";
3349 : static const char __pyx_k_mode[] = "mode";
3350 : static const char __pyx_k_name[] = "name";
3351 : static const char __pyx_k_ndim[] = "ndim";
3352 : static const char __pyx_k_pack[] = "pack";
3353 : static const char __pyx_k_repr[] = "__repr__";
3354 : static const char __pyx_k_self[] = "self";
3355 : static const char __pyx_k_sink[] = "sink";
3356 : static const char __pyx_k_size[] = "size";
3357 : static const char __pyx_k_spec[] = "__spec__";
3358 : static const char __pyx_k_step[] = "step";
3359 : static const char __pyx_k_stop[] = "stop";
3360 : static const char __pyx_k_test[] = "__test__";
3361 : static const char __pyx_k_type[] = "type";
3362 : static const char __pyx_k_0_and[] = "0 and {}";
3363 : static const char __pyx_k_ASCII[] = "ASCII";
3364 : static const char __pyx_k_DTYPE[] = "DTYPE";
3365 : static const char __pyx_k_ITYPE[] = "ITYPE";
3366 : static const char __pyx_k_a_end[] = "a_end";
3367 : static const char __pyx_k_a_ptr[] = "a_ptr";
3368 : static const char __pyx_k_class[] = "__class__";
3369 : static const char __pyx_k_count[] = "count";
3370 : static const char __pyx_k_dinic[] = "dinic";
3371 : static const char __pyx_k_dtype[] = "dtype";
3372 : static const char __pyx_k_empty[] = "empty";
3373 : static const char __pyx_k_error[] = "error";
3374 : static const char __pyx_k_flags[] = "flags";
3375 : static const char __pyx_k_iinfo[] = "iinfo";
3376 : static const char __pyx_k_index[] = "index";
3377 : static const char __pyx_k_int32[] = "int32";
3378 : static const char __pyx_k_numpy[] = "numpy";
3379 : static const char __pyx_k_range[] = "range";
3380 : static const char __pyx_k_shape[] = "shape";
3381 : static const char __pyx_k_start[] = "start";
3382 : static const char __pyx_k_super[] = "super";
3383 : static const char __pyx_k_tails[] = "tails";
3384 : static const char __pyx_k_tools[] = "_tools";
3385 : static const char __pyx_k_zeros[] = "zeros";
3386 : static const char __pyx_k_arange[] = "arange";
3387 : static const char __pyx_k_astype[] = "astype";
3388 : static const char __pyx_k_at_end[] = "at_end";
3389 : static const char __pyx_k_at_ptr[] = "at_ptr";
3390 : static const char __pyx_k_b_data[] = "b_data";
3391 : static const char __pyx_k_enable[] = "enable";
3392 : static const char __pyx_k_encode[] = "encode";
3393 : static const char __pyx_k_format[] = "format";
3394 : static const char __pyx_k_import[] = "__import__";
3395 : static const char __pyx_k_indptr[] = "indptr";
3396 : static const char __pyx_k_method[] = "method";
3397 : static const char __pyx_k_module[] = "__module__";
3398 : static const char __pyx_k_move_a[] = "move_a";
3399 : static const char __pyx_k_name_2[] = "__name__";
3400 : static const char __pyx_k_pickle[] = "pickle";
3401 : static const char __pyx_k_reduce[] = "__reduce__";
3402 : static const char __pyx_k_source[] = "source";
3403 : static const char __pyx_k_struct[] = "struct";
3404 : static const char __pyx_k_unpack[] = "unpack";
3405 : static const char __pyx_k_update[] = "update";
3406 : static const char __pyx_k_asarray[] = "asarray";
3407 : static const char __pyx_k_csgraph[] = "csgraph";
3408 : static const char __pyx_k_disable[] = "disable";
3409 : static const char __pyx_k_float64[] = "float64";
3410 : static const char __pyx_k_fortran[] = "fortran";
3411 : static const char __pyx_k_indices[] = "indices";
3412 : static const char __pyx_k_memview[] = "memview";
3413 : static const char __pyx_k_move_at[] = "move_at";
3414 : static const char __pyx_k_prepare[] = "__prepare__";
3415 : static const char __pyx_k_res_ptr[] = "res_ptr";
3416 : static const char __pyx_k_Ellipsis[] = "Ellipsis";
3417 : static const char __pyx_k_Sequence[] = "Sequence";
3418 : static const char __pyx_k_getstate[] = "__getstate__";
3419 : static const char __pyx_k_issparse[] = "issparse";
3420 : static const char __pyx_k_itemsize[] = "itemsize";
3421 : static const char __pyx_k_pyx_type[] = "__pyx_type";
3422 : static const char __pyx_k_qualname[] = "__qualname__";
3423 : static const char __pyx_k_register[] = "register";
3424 : static const char __pyx_k_res_data[] = "res_data";
3425 : static const char __pyx_k_set_name[] = "__set_name__";
3426 : static const char __pyx_k_setstate[] = "__setstate__";
3427 : static const char __pyx_k_TypeError[] = "TypeError";
3428 : static const char __pyx_k_csr_array[] = "csr_array";
3429 : static const char __pyx_k_enumerate[] = "enumerate";
3430 : static const char __pyx_k_isenabled[] = "isenabled";
3431 : static const char __pyx_k_metaclass[] = "__metaclass__";
3432 : static const char __pyx_k_pyx_state[] = "__pyx_state";
3433 : static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3434 : static const char __pyx_k_transpose[] = "transpose";
3435 : static const char __pyx_k_IndexError[] = "IndexError";
3436 : static const char __pyx_k_ValueError[] = "ValueError";
3437 : static const char __pyx_k_csr_matrix[] = "csr_matrix";
3438 : static const char __pyx_k_flow_array[] = "flow_array";
3439 : static const char __pyx_k_flow_value[] = "flow_value";
3440 : static const char __pyx_k_make_tails[] = "_make_tails";
3441 : static const char __pyx_k_pyx_result[] = "__pyx_result";
3442 : static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3443 : static const char __pyx_k_res_indptr[] = "res_indptr";
3444 : static const char __pyx_k_ImportError[] = "ImportError";
3445 : static const char __pyx_k_MemoryError[] = "MemoryError";
3446 : static const char __pyx_k_PickleError[] = "PickleError";
3447 : static const char __pyx_k_a_data_view[] = "a_data_view";
3448 : static const char __pyx_k_collections[] = "collections";
3449 : static const char __pyx_k_flow_matrix[] = "flow_matrix";
3450 : static const char __pyx_k_res_indices[] = "res_indices";
3451 : static const char __pyx_k_source_flow[] = "source_flow";
3452 : static const char __pyx_k_csgraph_orig[] = "csgraph_orig";
3453 : static const char __pyx_k_edmonds_karp[] = "edmonds_karp";
3454 : static const char __pyx_k_initializing[] = "_initializing";
3455 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3456 : static const char __pyx_k_maximum_flow[] = "maximum_flow";
3457 : static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3458 : static const char __pyx_k_rev_edge_ptr[] = "rev_edge_ptr";
3459 : static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
3460 : static const char __pyx_k_stringsource[] = "<stringsource>";
3461 : static const char __pyx_k_version_info[] = "version_info";
3462 : static const char __pyx_k_a_indptr_view[] = "a_indptr_view";
3463 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3464 : static const char __pyx_k_init_subclass[] = "__init_subclass__";
3465 : static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3466 : static const char __pyx_k_res_data_view[] = "res_data_view";
3467 : static const char __pyx_k_target_format[] = "target_format";
3468 : static const char __pyx_k_AssertionError[] = "AssertionError";
3469 : static const char __pyx_k_a_indices_view[] = "a_indices_view";
3470 : static const char __pyx_k_at_indptr_view[] = "at_indptr_view";
3471 : static const char __pyx_k_csgraph_indptr[] = "csgraph_indptr";
3472 : static const char __pyx_k_sorted_indices[] = "sorted_indices";
3473 : static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3474 : static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3475 : static const char __pyx_k_at_indices_view[] = "at_indices_view";
3476 : static const char __pyx_k_collections_abc[] = "collections.abc";
3477 : static const char __pyx_k_csgraph_indices[] = "csgraph_indices";
3478 : static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3479 : static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3480 : static const char __pyx_k_res_indptr_view[] = "res_indptr_view";
3481 : static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3482 : static const char __pyx_k_is_pydata_sparse[] = "is_pydata_sparse";
3483 : static const char __pyx_k_res_indices_view[] = "res_indices_view";
3484 : static const char __pyx_k_MaximumFlowResult[] = "MaximumFlowResult";
3485 : static const char __pyx_k_add_reverse_edges[] = "_add_reverse_edges";
3486 : static const char __pyx_k_from_scipy_sparse[] = "from_scipy_sparse";
3487 : static const char __pyx_k_pydata_sparse_cls[] = "pydata_sparse_cls";
3488 : static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3489 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3490 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3491 : static const char __pyx_k_has_sorted_indices[] = "has_sorted_indices";
3492 : static const char __pyx_k_is_pydata_spmatrix[] = "is_pydata_spmatrix";
3493 : static const char __pyx_k_make_edge_pointers[] = "_make_edge_pointers";
3494 : static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3495 : static const char __pyx_k_maximum_flow_line_36[] = "maximum_flow (line 36)";
3496 : static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3497 : static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
3498 : static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3499 : static const char __pyx_k_safe_downcast_indices[] = "_safe_downcast_indices";
3500 : static const char __pyx_k_scipy_sparse__sputils[] = "scipy.sparse._sputils";
3501 : static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
3502 : static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3503 : static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3504 : static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3505 : static const char __pyx_k_MaximumFlowResult___init[] = "MaximumFlowResult.__init__";
3506 : static const char __pyx_k_MaximumFlowResult___repr[] = "MaximumFlowResult.__repr__";
3507 : static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3508 : static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
3509 : static const char __pyx_k_scipy_sparse_csgraph__flow[] = "scipy.sparse.csgraph._flow";
3510 : static const char __pyx_k_sink_value_must_be_between[] = "sink value ({}) must be between ";
3511 : static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
3512 : static const char __pyx_k_graph_must_be_in_CSR_format[] = "graph must be in CSR format";
3513 : static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3514 : static const char __pyx_k_method_is_not_supported_yet[] = "{} method is not supported yet.";
3515 : static const char __pyx_k_source_value_must_be_between[] = "source value ({}) must be between ";
3516 : static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3517 : static const char __pyx_k_convert_pydata_sparse_to_scipy[] = "convert_pydata_sparse_to_scipy";
3518 : static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3519 : static const char __pyx_k_MaximumFlowResult_with_value_of[] = "MaximumFlowResult with value of %d";
3520 : static const char __pyx_k_home_czgdp18079_Quansight_scipy[] = "/home/czgdp18079/Quansight/scipy/scipy/sparse/csgraph/_flow.pyx";
3521 : static const char __pyx_k_maximum_flow_csgraph_source_sin[] = "\n maximum_flow(csgraph, source, sink)\n\n Maximize the flow between two vertices in a graph.\n\n .. versionadded:: 1.4.0\n\n Parameters\n ----------\n csgraph : csr_array\n The square matrix representing a directed graph whose (i, j)'th entry\n is an integer representing the capacity of the edge between\n vertices i and j.\n source : int\n The source vertex from which the flow flows.\n sink : int\n The sink vertex to which the flow flows.\n method: {'edmonds_karp', 'dinic'}, optional\n The method/algorithm to be used for computing the maximum flow.\n Following methods are supported,\n\n * 'edmonds_karp': Edmonds Karp algorithm in [1]_.\n * 'dinic': Dinic's algorithm in [4]_.\n\n Default is 'dinic'.\n\n .. versionadded:: 1.8.0\n\n Returns\n -------\n res : MaximumFlowResult\n A maximum flow represented by a ``MaximumFlowResult``\n which includes the value of the flow in ``flow_value``,\n and the flow graph in ``flow``.\n\n Raises\n ------\n TypeError:\n if the input graph is not in CSR format.\n\n ValueError:\n if the capacity values are not integers, or the source or sink are out\n of bounds.\n\n Notes\n -----\n This solves the maximum flow problem on a given directed weighted graph:\n A flow associates to every edge a value, also called a flow, less than the\n capacity of the edge, so that for every vertex (apart from the source and\n the sink vertices), the total incoming flow is equal to the total outgoing\n flow. The value of a flow is the sum of the flow of all edges leaving the\n source vertex, and the maximum flow problem consists of finding a flow\n whose value is maximal.\n\n By the max-flow min-cut theorem, the maximal value of the flow is also the\n total weight of the edges in a minimum cut.\n\n To solve the problem, we provide Edmonds--Karp [1]_"" and Dinic's algorithm\n [4]_. The implementation of both algorithms strive to exploit sparsity.\n The time complexity of the former :math:`O(|V|\\,|E|^2)` and its space\n complexity is :math:`O(|E|)`. The latter achieves its performance by\n building level graphs and finding blocking flows in them. Its time\n complexity is :math:`O(|V|^2\\,|E|)` and its space complexity is\n :math:`O(|E|)`.\n\n The maximum flow problem is usually defined with real valued capacities,\n but we require that all capacities are integral to ensure convergence. When\n dealing with rational capacities, or capacities belonging to\n :math:`x\\mathbb{Q}` for some fixed :math:`x \\in \\mathbb{R}`, it is possible\n to reduce the problem to the integral case by scaling all capacities\n accordingly.\n\n Solving a maximum-flow problem can be used for example for graph cuts\n optimization in computer vision [3]_.\n\n References\n ----------\n .. [1] Edmonds, J. and Karp, R. M.\n Theoretical improvements in algorithmic efficiency for network flow\n problems. 1972. Journal of the ACM. 19 (2): pp. 248-264\n .. [2] Cormen, T. H. and Leiserson, C. E. and Rivest, R. L. and Stein C.\n Introduction to Algorithms. Second Edition. 2001. MIT Press.\n .. [3] https://en.wikipedia.org/wiki/Graph_cuts_in_computer_vision\n .. [4] Dinic, Efim A.\n Algorithm for solution of a problem of maximum flow in networks with\n power estimation. In Soviet Math. Doklady, vol. 11, pp. 1277-1280.\n 1970.\n\n Examples\n --------\n Perhaps the simplest flow problem is that of a graph of only two vertices\n with an edge from source (0) to sink (1)::\n\n (0) --5--> (1)\n\n Here, the maximum flow is simply the capacity of the edge:\n\n >>> import numpy as np\n >>> from scipy.sparse import csr_array\n >>> from scipy.sparse.csgraph import maximum_flow\n >>> graph = csr_array([[0, 5], ""[0, 0]])\n >>> maximum_flow(graph, 0, 1).flow_value\n 5\n >>> maximum_flow(graph, 0, 1, method='edmonds_karp').flow_value\n 5\n\n If, on the other hand, there is a bottleneck between source and sink, that\n can reduce the maximum flow::\n\n (0) --5--> (1) --3--> (2)\n\n >>> graph = csr_array([[0, 5, 0], [0, 0, 3], [0, 0, 0]])\n >>> maximum_flow(graph, 0, 2).flow_value\n 3\n\n A less trivial example is given in [2]_, Chapter 26.1:\n\n >>> graph = csr_array([[0, 16, 13, 0, 0, 0],\n ... [0, 0, 10, 12, 0, 0],\n ... [0, 4, 0, 0, 14, 0],\n ... [0, 0, 9, 0, 0, 20],\n ... [0, 0, 0, 7, 0, 4],\n ... [0, 0, 0, 0, 0, 0]])\n >>> maximum_flow(graph, 0, 5).flow_value\n 23\n\n It is possible to reduce the problem of finding a maximum matching in a\n bipartite graph to a maximum flow problem: Let :math:`G = ((U, V), E)` be a\n bipartite graph. Then, add to the graph a source vertex with edges to every\n vertex in :math:`U` and a sink vertex with edges from every vertex in\n :math:`V`. Finally, give every edge in the resulting graph a capacity of 1.\n Then, a maximum flow in the new graph gives a maximum matching in the\n original graph consisting of the edges in :math:`E` whose flow is positive.\n\n Assume that the edges are represented by a\n :math:`\\lvert U \\rvert \\times \\lvert V \\rvert` matrix in CSR format whose\n :math:`(i, j)`'th entry is 1 if there is an edge from :math:`i \\in U` to\n :math:`j \\in V` and 0 otherwise; that is, the input is of the form required\n by :func:`maximum_bipartite_matching`. Then the CSR representation of the\n graph constructed above contains this matrix as a block. Here's an example:\n\n >>> graph = csr_array([[0, 1, 0, 1], [1, 0, 1, 0], [0, 1, 1, 0]])\n >>> print(graph.toarray())\n [[0 1 0 1]\n [1 0 1 0]\n [0 ""1 1 0]]\n >>> i, j = graph.shape\n >>> n = graph.nnz\n >>> indptr = np.concatenate([[0],\n ... graph.indptr + i,\n ... np.arange(n + i + 1, n + i + j + 1),\n ... [n + i + j]])\n >>> indices = np.concatenate([np.arange(1, i + 1),\n ... graph.indices + i + 1,\n ... np.repeat(i + j + 1, j)])\n >>> data = np.ones(n + i + j, dtype=int)\n >>>\n >>> graph_flow = csr_array((data, indices, indptr))\n >>> print(graph_flow.toarray())\n [[0 1 1 1 0 0 0 0 0]\n [0 0 0 0 0 1 0 1 0]\n [0 0 0 0 1 0 1 0 0]\n [0 0 0 0 0 1 1 0 0]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 0]]\n\n At this point, we can find the maximum flow between the added sink and the\n added source and the desired matching can be obtained by restricting the\n flow function to the block corresponding to the original graph:\n\n >>> result = maximum_flow(graph_flow, 0, i+j+1, method='dinic')\n >>> matching = result.flow[1:i+1, i+1:i+j+1]\n >>> print(matching.toarray())\n [[0 1 0 0]\n [1 0 0 0]\n [0 0 1 0]]\n\n This tells us that the first, second, and third vertex in :math:`U` are\n matched with the second, first, and third vertex in :math:`V` respectively.\n\n While this solves the maximum bipartite matching problem in general, note\n that algorithms specialized to that problem, such as\n :func:`maximum_bipartite_matching`, will generally perform better.\n\n This approach can also be used to solve various common generalizations of\n the maximum bipartite matching problem. If, for instance, some vertices can\n be matched with more than one other vertex, this may be handled by\n modifying the capacities of the new graph appropriately.\n\n ";
3522 : static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
3523 : static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3524 : static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3525 : static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3526 : static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3527 : static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3528 : static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3529 : static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
3530 : static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3531 : static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
3532 : static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
3533 : static const char __pyx_k_Represents_the_result_of_a_maxim[] = "Represents the result of a maximum flow calculation.\n\n Attributes\n ----------\n flow_value : int\n The value of the maximum flow.\n flow : csr_array\n The maximum flow.\n ";
3534 : static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3535 : static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
3536 : static const char __pyx_k_graph_capacities_must_be_integer[] = "graph capacities must be integers";
3537 : static const char __pyx_k_graph_must_be_specified_as_a_squ[] = "graph must be specified as a square matrix.";
3538 : static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3539 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3540 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3541 : static const char __pyx_k_source_and_sink_vertices_must_di[] = "source and sink vertices must differ";
3542 : static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3543 : /* #### Code section: decls ### */
3544 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3545 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3546 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3547 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3548 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3549 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3550 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3551 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3552 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3553 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3554 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3555 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3556 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3557 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3558 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3559 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3560 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3561 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3562 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3563 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3564 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3565 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3566 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3567 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3568 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3569 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3570 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3571 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3572 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3573 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3574 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3575 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3576 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3577 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3578 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3579 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3580 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3581 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3582 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3583 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3584 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3585 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_flow_value, PyObject *__pyx_v_flow); /* proto */
3586 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
3587 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_maximum_flow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_csgraph, PyObject *__pyx_v_source, PyObject *__pyx_v_sink, PyObject *__pyx_v_method); /* proto */
3588 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_2_add_reverse_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */
3589 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_4_make_edge_pointers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */
3590 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_6_make_tails(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */
3591 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3592 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3593 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3594 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3595 : /* #### Code section: late_includes ### */
3596 : /* #### Code section: module_state ### */
3597 : typedef struct {
3598 : PyObject *__pyx_d;
3599 : PyObject *__pyx_b;
3600 : PyObject *__pyx_cython_runtime;
3601 : PyObject *__pyx_empty_tuple;
3602 : PyObject *__pyx_empty_bytes;
3603 : PyObject *__pyx_empty_unicode;
3604 : #ifdef __Pyx_CyFunction_USED
3605 : PyTypeObject *__pyx_CyFunctionType;
3606 : #endif
3607 : #ifdef __Pyx_FusedFunction_USED
3608 : PyTypeObject *__pyx_FusedFunctionType;
3609 : #endif
3610 : #ifdef __Pyx_Generator_USED
3611 : PyTypeObject *__pyx_GeneratorType;
3612 : #endif
3613 : #ifdef __Pyx_IterableCoroutine_USED
3614 : PyTypeObject *__pyx_IterableCoroutineType;
3615 : #endif
3616 : #ifdef __Pyx_Coroutine_USED
3617 : PyTypeObject *__pyx_CoroutineAwaitType;
3618 : #endif
3619 : #ifdef __Pyx_Coroutine_USED
3620 : PyTypeObject *__pyx_CoroutineType;
3621 : #endif
3622 : #if CYTHON_USE_MODULE_STATE
3623 : #endif
3624 : #if CYTHON_USE_MODULE_STATE
3625 : #endif
3626 : #if CYTHON_USE_MODULE_STATE
3627 : #endif
3628 : #if CYTHON_USE_MODULE_STATE
3629 : #endif
3630 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3631 : #if CYTHON_USE_MODULE_STATE
3632 : #endif
3633 : #if CYTHON_USE_MODULE_STATE
3634 : #endif
3635 : #if CYTHON_USE_MODULE_STATE
3636 : #endif
3637 : #if CYTHON_USE_MODULE_STATE
3638 : #endif
3639 : #if CYTHON_USE_MODULE_STATE
3640 : #endif
3641 : PyTypeObject *__pyx_ptype_5numpy_dtype;
3642 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
3643 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
3644 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
3645 : PyTypeObject *__pyx_ptype_5numpy_generic;
3646 : PyTypeObject *__pyx_ptype_5numpy_number;
3647 : PyTypeObject *__pyx_ptype_5numpy_integer;
3648 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3649 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3650 : PyTypeObject *__pyx_ptype_5numpy_inexact;
3651 : PyTypeObject *__pyx_ptype_5numpy_floating;
3652 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3653 : PyTypeObject *__pyx_ptype_5numpy_flexible;
3654 : PyTypeObject *__pyx_ptype_5numpy_character;
3655 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
3656 : #if CYTHON_USE_MODULE_STATE
3657 : PyObject *__pyx_type___pyx_array;
3658 : PyObject *__pyx_type___pyx_MemviewEnum;
3659 : PyObject *__pyx_type___pyx_memoryview;
3660 : PyObject *__pyx_type___pyx_memoryviewslice;
3661 : #endif
3662 : PyTypeObject *__pyx_array_type;
3663 : PyTypeObject *__pyx_MemviewEnum_type;
3664 : PyTypeObject *__pyx_memoryview_type;
3665 : PyTypeObject *__pyx_memoryviewslice_type;
3666 : PyObject *__pyx_kp_u_;
3667 : PyObject *__pyx_kp_u_0_and;
3668 : PyObject *__pyx_n_s_ASCII;
3669 : PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
3670 : PyObject *__pyx_n_s_AssertionError;
3671 : PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3672 : PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3673 : PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3674 : PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3675 : PyObject *__pyx_kp_u_Cannot_index_with_type;
3676 : PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
3677 : PyObject *__pyx_n_s_DTYPE;
3678 : PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
3679 : PyObject *__pyx_n_s_Ellipsis;
3680 : PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3681 : PyObject *__pyx_n_s_ITYPE;
3682 : PyObject *__pyx_n_s_ImportError;
3683 : PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
3684 : PyObject *__pyx_n_s_IndexError;
3685 : PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
3686 : PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3687 : PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
3688 : PyObject *__pyx_kp_u_Invalid_shape_in_axis;
3689 : PyObject *__pyx_n_s_MaximumFlowResult;
3690 : PyObject *__pyx_n_s_MaximumFlowResult___init;
3691 : PyObject *__pyx_n_s_MaximumFlowResult___repr;
3692 : PyObject *__pyx_kp_u_MaximumFlowResult_with_value_of;
3693 : PyObject *__pyx_n_s_MemoryError;
3694 : PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3695 : PyObject *__pyx_kp_s_MemoryView_of_r_object;
3696 : PyObject *__pyx_n_b_O;
3697 : PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
3698 : PyObject *__pyx_n_s_PickleError;
3699 : PyObject *__pyx_kp_s_Represents_the_result_of_a_maxim;
3700 : PyObject *__pyx_n_s_Sequence;
3701 : PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
3702 : PyObject *__pyx_n_s_TypeError;
3703 : PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3704 : PyObject *__pyx_n_s_ValueError;
3705 : PyObject *__pyx_n_s_View_MemoryView;
3706 : PyObject *__pyx_kp_u__2;
3707 : PyObject *__pyx_n_s__3;
3708 : PyObject *__pyx_n_s__38;
3709 : PyObject *__pyx_kp_u__6;
3710 : PyObject *__pyx_kp_u__7;
3711 : PyObject *__pyx_n_s_a;
3712 : PyObject *__pyx_n_s_a_data_view;
3713 : PyObject *__pyx_n_s_a_end;
3714 : PyObject *__pyx_n_s_a_indices_view;
3715 : PyObject *__pyx_n_s_a_indptr_view;
3716 : PyObject *__pyx_n_s_a_ptr;
3717 : PyObject *__pyx_n_s_abc;
3718 : PyObject *__pyx_n_s_add_reverse_edges;
3719 : PyObject *__pyx_n_s_allocate_buffer;
3720 : PyObject *__pyx_kp_u_and;
3721 : PyObject *__pyx_n_s_arange;
3722 : PyObject *__pyx_n_s_asarray;
3723 : PyObject *__pyx_n_s_astype;
3724 : PyObject *__pyx_n_s_asyncio_coroutines;
3725 : PyObject *__pyx_n_s_at;
3726 : PyObject *__pyx_n_s_at_end;
3727 : PyObject *__pyx_n_s_at_indices_view;
3728 : PyObject *__pyx_n_s_at_indptr_view;
3729 : PyObject *__pyx_n_s_at_ptr;
3730 : PyObject *__pyx_n_s_b;
3731 : PyObject *__pyx_n_s_b_data;
3732 : PyObject *__pyx_n_s_base;
3733 : PyObject *__pyx_n_s_c;
3734 : PyObject *__pyx_n_u_c;
3735 : PyObject *__pyx_n_s_class;
3736 : PyObject *__pyx_n_s_class_getitem;
3737 : PyObject *__pyx_n_s_cline_in_traceback;
3738 : PyObject *__pyx_n_s_collections;
3739 : PyObject *__pyx_kp_s_collections_abc;
3740 : PyObject *__pyx_kp_s_contiguous_and_direct;
3741 : PyObject *__pyx_kp_s_contiguous_and_indirect;
3742 : PyObject *__pyx_n_s_convert_pydata_sparse_to_scipy;
3743 : PyObject *__pyx_n_s_count;
3744 : PyObject *__pyx_n_s_csgraph;
3745 : PyObject *__pyx_n_s_csgraph_indices;
3746 : PyObject *__pyx_n_s_csgraph_indptr;
3747 : PyObject *__pyx_n_s_csgraph_orig;
3748 : PyObject *__pyx_n_u_csr;
3749 : PyObject *__pyx_n_s_csr_array;
3750 : PyObject *__pyx_n_s_csr_matrix;
3751 : PyObject *__pyx_n_s_data;
3752 : PyObject *__pyx_n_s_dict;
3753 : PyObject *__pyx_n_u_dinic;
3754 : PyObject *__pyx_kp_u_disable;
3755 : PyObject *__pyx_n_s_doc;
3756 : PyObject *__pyx_n_s_dtype;
3757 : PyObject *__pyx_n_s_dtype_is_object;
3758 : PyObject *__pyx_n_u_edmonds_karp;
3759 : PyObject *__pyx_n_s_empty;
3760 : PyObject *__pyx_kp_u_enable;
3761 : PyObject *__pyx_n_s_encode;
3762 : PyObject *__pyx_n_s_enumerate;
3763 : PyObject *__pyx_n_s_error;
3764 : PyObject *__pyx_n_s_flags;
3765 : PyObject *__pyx_n_s_float64;
3766 : PyObject *__pyx_n_s_flow;
3767 : PyObject *__pyx_n_s_flow_array;
3768 : PyObject *__pyx_n_s_flow_matrix;
3769 : PyObject *__pyx_n_s_flow_value;
3770 : PyObject *__pyx_n_s_format;
3771 : PyObject *__pyx_n_s_fortran;
3772 : PyObject *__pyx_n_u_fortran;
3773 : PyObject *__pyx_n_s_from_scipy_sparse;
3774 : PyObject *__pyx_kp_u_gc;
3775 : PyObject *__pyx_n_s_getstate;
3776 : PyObject *__pyx_kp_u_got;
3777 : PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
3778 : PyObject *__pyx_kp_u_graph_capacities_must_be_integer;
3779 : PyObject *__pyx_kp_u_graph_must_be_in_CSR_format;
3780 : PyObject *__pyx_kp_u_graph_must_be_specified_as_a_squ;
3781 : PyObject *__pyx_n_s_has_sorted_indices;
3782 : PyObject *__pyx_kp_s_home_czgdp18079_Quansight_scipy;
3783 : PyObject *__pyx_n_s_i;
3784 : PyObject *__pyx_n_s_id;
3785 : PyObject *__pyx_n_s_iinfo;
3786 : PyObject *__pyx_n_s_import;
3787 : PyObject *__pyx_n_s_index;
3788 : PyObject *__pyx_n_s_indices;
3789 : PyObject *__pyx_n_s_indptr;
3790 : PyObject *__pyx_n_s_init;
3791 : PyObject *__pyx_n_s_init_subclass;
3792 : PyObject *__pyx_n_s_initializing;
3793 : PyObject *__pyx_n_s_int32;
3794 : PyObject *__pyx_n_s_is_coroutine;
3795 : PyObject *__pyx_n_s_is_pydata_sparse;
3796 : PyObject *__pyx_n_s_is_pydata_spmatrix;
3797 : PyObject *__pyx_kp_u_isenabled;
3798 : PyObject *__pyx_n_s_issparse;
3799 : PyObject *__pyx_n_s_itemsize;
3800 : PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3801 : PyObject *__pyx_n_s_j;
3802 : PyObject *__pyx_n_s_m;
3803 : PyObject *__pyx_n_s_main;
3804 : PyObject *__pyx_n_s_make_edge_pointers;
3805 : PyObject *__pyx_n_s_make_tails;
3806 : PyObject *__pyx_n_s_max;
3807 : PyObject *__pyx_n_s_maximum_flow;
3808 : PyObject *__pyx_kp_u_maximum_flow_csgraph_source_sin;
3809 : PyObject *__pyx_kp_u_maximum_flow_line_36;
3810 : PyObject *__pyx_n_s_memview;
3811 : PyObject *__pyx_n_s_metaclass;
3812 : PyObject *__pyx_n_s_method;
3813 : PyObject *__pyx_kp_u_method_is_not_supported_yet;
3814 : PyObject *__pyx_n_s_mode;
3815 : PyObject *__pyx_n_s_module;
3816 : PyObject *__pyx_n_s_move_a;
3817 : PyObject *__pyx_n_s_move_at;
3818 : PyObject *__pyx_n_s_n;
3819 : PyObject *__pyx_n_s_name;
3820 : PyObject *__pyx_n_s_name_2;
3821 : PyObject *__pyx_n_s_ndim;
3822 : PyObject *__pyx_n_s_new;
3823 : PyObject *__pyx_n_s_nnz;
3824 : PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3825 : PyObject *__pyx_n_s_np;
3826 : PyObject *__pyx_n_s_numpy;
3827 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
3828 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
3829 : PyObject *__pyx_n_s_obj;
3830 : PyObject *__pyx_n_s_pack;
3831 : PyObject *__pyx_n_s_pickle;
3832 : PyObject *__pyx_n_s_prepare;
3833 : PyObject *__pyx_n_s_pydata_sparse_cls;
3834 : PyObject *__pyx_n_s_pyx_PickleError;
3835 : PyObject *__pyx_n_s_pyx_checksum;
3836 : PyObject *__pyx_n_s_pyx_result;
3837 : PyObject *__pyx_n_s_pyx_state;
3838 : PyObject *__pyx_n_s_pyx_type;
3839 : PyObject *__pyx_n_s_pyx_unpickle_Enum;
3840 : PyObject *__pyx_n_s_pyx_vtable;
3841 : PyObject *__pyx_n_s_qualname;
3842 : PyObject *__pyx_n_s_range;
3843 : PyObject *__pyx_n_s_reduce;
3844 : PyObject *__pyx_n_s_reduce_cython;
3845 : PyObject *__pyx_n_s_reduce_ex;
3846 : PyObject *__pyx_n_s_register;
3847 : PyObject *__pyx_n_s_repr;
3848 : PyObject *__pyx_n_s_res_data;
3849 : PyObject *__pyx_n_s_res_data_view;
3850 : PyObject *__pyx_n_s_res_indices;
3851 : PyObject *__pyx_n_s_res_indices_view;
3852 : PyObject *__pyx_n_s_res_indptr;
3853 : PyObject *__pyx_n_s_res_indptr_view;
3854 : PyObject *__pyx_n_s_res_ptr;
3855 : PyObject *__pyx_n_s_rev_edge_ptr;
3856 : PyObject *__pyx_n_s_safe_downcast_indices;
3857 : PyObject *__pyx_n_s_scipy_sparse;
3858 : PyObject *__pyx_n_s_scipy_sparse__sputils;
3859 : PyObject *__pyx_n_s_scipy_sparse_csgraph__flow;
3860 : PyObject *__pyx_n_s_self;
3861 : PyObject *__pyx_n_s_set_name;
3862 : PyObject *__pyx_n_s_setstate;
3863 : PyObject *__pyx_n_s_setstate_cython;
3864 : PyObject *__pyx_n_s_shape;
3865 : PyObject *__pyx_n_s_sink;
3866 : PyObject *__pyx_kp_u_sink_value_must_be_between;
3867 : PyObject *__pyx_n_s_size;
3868 : PyObject *__pyx_n_s_sorted_indices;
3869 : PyObject *__pyx_n_s_source;
3870 : PyObject *__pyx_kp_u_source_and_sink_vertices_must_di;
3871 : PyObject *__pyx_n_s_source_flow;
3872 : PyObject *__pyx_kp_u_source_value_must_be_between;
3873 : PyObject *__pyx_n_s_spec;
3874 : PyObject *__pyx_n_s_start;
3875 : PyObject *__pyx_n_s_step;
3876 : PyObject *__pyx_n_s_stop;
3877 : PyObject *__pyx_kp_s_strided_and_direct;
3878 : PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3879 : PyObject *__pyx_kp_s_strided_and_indirect;
3880 : PyObject *__pyx_kp_s_stringsource;
3881 : PyObject *__pyx_n_s_struct;
3882 : PyObject *__pyx_n_s_sum;
3883 : PyObject *__pyx_n_s_super;
3884 : PyObject *__pyx_n_s_sys;
3885 : PyObject *__pyx_n_s_tails;
3886 : PyObject *__pyx_n_s_target_format;
3887 : PyObject *__pyx_n_s_test;
3888 : PyObject *__pyx_n_s_tools;
3889 : PyObject *__pyx_n_s_transpose;
3890 : PyObject *__pyx_n_s_type;
3891 : PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3892 : PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3893 : PyObject *__pyx_n_s_unpack;
3894 : PyObject *__pyx_n_s_update;
3895 : PyObject *__pyx_n_s_version_info;
3896 : PyObject *__pyx_n_s_zeros;
3897 : PyObject *__pyx_int_0;
3898 : PyObject *__pyx_int_1;
3899 : PyObject *__pyx_int_2;
3900 : PyObject *__pyx_int_3;
3901 : PyObject *__pyx_int_112105877;
3902 : PyObject *__pyx_int_136983863;
3903 : PyObject *__pyx_int_184977713;
3904 : PyObject *__pyx_int_neg_1;
3905 : PyObject *__pyx_slice__5;
3906 : PyObject *__pyx_tuple__4;
3907 : PyObject *__pyx_tuple__8;
3908 : PyObject *__pyx_tuple__9;
3909 : PyObject *__pyx_tuple__10;
3910 : PyObject *__pyx_tuple__11;
3911 : PyObject *__pyx_tuple__12;
3912 : PyObject *__pyx_tuple__13;
3913 : PyObject *__pyx_tuple__14;
3914 : PyObject *__pyx_tuple__15;
3915 : PyObject *__pyx_tuple__16;
3916 : PyObject *__pyx_tuple__17;
3917 : PyObject *__pyx_tuple__18;
3918 : PyObject *__pyx_tuple__19;
3919 : PyObject *__pyx_tuple__20;
3920 : PyObject *__pyx_tuple__21;
3921 : PyObject *__pyx_tuple__22;
3922 : PyObject *__pyx_tuple__23;
3923 : PyObject *__pyx_tuple__24;
3924 : PyObject *__pyx_tuple__26;
3925 : PyObject *__pyx_tuple__28;
3926 : PyObject *__pyx_tuple__30;
3927 : PyObject *__pyx_tuple__32;
3928 : PyObject *__pyx_tuple__34;
3929 : PyObject *__pyx_tuple__36;
3930 : PyObject *__pyx_codeobj__25;
3931 : PyObject *__pyx_codeobj__27;
3932 : PyObject *__pyx_codeobj__29;
3933 : PyObject *__pyx_codeobj__31;
3934 : PyObject *__pyx_codeobj__33;
3935 : PyObject *__pyx_codeobj__35;
3936 : PyObject *__pyx_codeobj__37;
3937 : } __pyx_mstate;
3938 :
3939 : #if CYTHON_USE_MODULE_STATE
3940 : #ifdef __cplusplus
3941 : namespace {
3942 : extern struct PyModuleDef __pyx_moduledef;
3943 : } /* anonymous namespace */
3944 : #else
3945 : static struct PyModuleDef __pyx_moduledef;
3946 : #endif
3947 :
3948 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
3949 :
3950 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
3951 :
3952 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
3953 : #else
3954 : static __pyx_mstate __pyx_mstate_global_static =
3955 : #ifdef __cplusplus
3956 : {};
3957 : #else
3958 : {0};
3959 : #endif
3960 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
3961 : #endif
3962 : /* #### Code section: module_state_clear ### */
3963 : #if CYTHON_USE_MODULE_STATE
3964 : static int __pyx_m_clear(PyObject *m) {
3965 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
3966 : if (!clear_module_state) return 0;
3967 : Py_CLEAR(clear_module_state->__pyx_d);
3968 : Py_CLEAR(clear_module_state->__pyx_b);
3969 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3970 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3971 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3972 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3973 : #ifdef __Pyx_CyFunction_USED
3974 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3975 : #endif
3976 : #ifdef __Pyx_FusedFunction_USED
3977 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
3978 : #endif
3979 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3980 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3981 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3982 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3983 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3984 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3985 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3986 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3987 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3988 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3989 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3990 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3991 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3992 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3993 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3994 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3995 : Py_CLEAR(clear_module_state->__pyx_array_type);
3996 : Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
3997 : Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
3998 : Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
3999 : Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4000 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4001 : Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4002 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4003 : Py_CLEAR(clear_module_state->__pyx_kp_u_);
4004 : Py_CLEAR(clear_module_state->__pyx_kp_u_0_and);
4005 : Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
4006 : Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4007 : Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
4008 : Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4009 : Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4010 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4011 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4012 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
4013 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4014 : Py_CLEAR(clear_module_state->__pyx_n_s_DTYPE);
4015 : Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4016 : Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
4017 : Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4018 : Py_CLEAR(clear_module_state->__pyx_n_s_ITYPE);
4019 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
4020 : Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4021 : Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
4022 : Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4023 : Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4024 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4025 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4026 : Py_CLEAR(clear_module_state->__pyx_n_s_MaximumFlowResult);
4027 : Py_CLEAR(clear_module_state->__pyx_n_s_MaximumFlowResult___init);
4028 : Py_CLEAR(clear_module_state->__pyx_n_s_MaximumFlowResult___repr);
4029 : Py_CLEAR(clear_module_state->__pyx_kp_u_MaximumFlowResult_with_value_of);
4030 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
4031 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4032 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
4033 : Py_CLEAR(clear_module_state->__pyx_n_b_O);
4034 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4035 : Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
4036 : Py_CLEAR(clear_module_state->__pyx_kp_s_Represents_the_result_of_a_maxim);
4037 : Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
4038 : Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4039 : Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
4040 : Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4041 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
4042 : Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
4043 : Py_CLEAR(clear_module_state->__pyx_kp_u__2);
4044 : Py_CLEAR(clear_module_state->__pyx_n_s__3);
4045 : Py_CLEAR(clear_module_state->__pyx_n_s__38);
4046 : Py_CLEAR(clear_module_state->__pyx_kp_u__6);
4047 : Py_CLEAR(clear_module_state->__pyx_kp_u__7);
4048 : Py_CLEAR(clear_module_state->__pyx_n_s_a);
4049 : Py_CLEAR(clear_module_state->__pyx_n_s_a_data_view);
4050 : Py_CLEAR(clear_module_state->__pyx_n_s_a_end);
4051 : Py_CLEAR(clear_module_state->__pyx_n_s_a_indices_view);
4052 : Py_CLEAR(clear_module_state->__pyx_n_s_a_indptr_view);
4053 : Py_CLEAR(clear_module_state->__pyx_n_s_a_ptr);
4054 : Py_CLEAR(clear_module_state->__pyx_n_s_abc);
4055 : Py_CLEAR(clear_module_state->__pyx_n_s_add_reverse_edges);
4056 : Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
4057 : Py_CLEAR(clear_module_state->__pyx_kp_u_and);
4058 : Py_CLEAR(clear_module_state->__pyx_n_s_arange);
4059 : Py_CLEAR(clear_module_state->__pyx_n_s_asarray);
4060 : Py_CLEAR(clear_module_state->__pyx_n_s_astype);
4061 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
4062 : Py_CLEAR(clear_module_state->__pyx_n_s_at);
4063 : Py_CLEAR(clear_module_state->__pyx_n_s_at_end);
4064 : Py_CLEAR(clear_module_state->__pyx_n_s_at_indices_view);
4065 : Py_CLEAR(clear_module_state->__pyx_n_s_at_indptr_view);
4066 : Py_CLEAR(clear_module_state->__pyx_n_s_at_ptr);
4067 : Py_CLEAR(clear_module_state->__pyx_n_s_b);
4068 : Py_CLEAR(clear_module_state->__pyx_n_s_b_data);
4069 : Py_CLEAR(clear_module_state->__pyx_n_s_base);
4070 : Py_CLEAR(clear_module_state->__pyx_n_s_c);
4071 : Py_CLEAR(clear_module_state->__pyx_n_u_c);
4072 : Py_CLEAR(clear_module_state->__pyx_n_s_class);
4073 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
4074 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
4075 : Py_CLEAR(clear_module_state->__pyx_n_s_collections);
4076 : Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
4077 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
4078 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
4079 : Py_CLEAR(clear_module_state->__pyx_n_s_convert_pydata_sparse_to_scipy);
4080 : Py_CLEAR(clear_module_state->__pyx_n_s_count);
4081 : Py_CLEAR(clear_module_state->__pyx_n_s_csgraph);
4082 : Py_CLEAR(clear_module_state->__pyx_n_s_csgraph_indices);
4083 : Py_CLEAR(clear_module_state->__pyx_n_s_csgraph_indptr);
4084 : Py_CLEAR(clear_module_state->__pyx_n_s_csgraph_orig);
4085 : Py_CLEAR(clear_module_state->__pyx_n_u_csr);
4086 : Py_CLEAR(clear_module_state->__pyx_n_s_csr_array);
4087 : Py_CLEAR(clear_module_state->__pyx_n_s_csr_matrix);
4088 : Py_CLEAR(clear_module_state->__pyx_n_s_data);
4089 : Py_CLEAR(clear_module_state->__pyx_n_s_dict);
4090 : Py_CLEAR(clear_module_state->__pyx_n_u_dinic);
4091 : Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
4092 : Py_CLEAR(clear_module_state->__pyx_n_s_doc);
4093 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
4094 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
4095 : Py_CLEAR(clear_module_state->__pyx_n_u_edmonds_karp);
4096 : Py_CLEAR(clear_module_state->__pyx_n_s_empty);
4097 : Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
4098 : Py_CLEAR(clear_module_state->__pyx_n_s_encode);
4099 : Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
4100 : Py_CLEAR(clear_module_state->__pyx_n_s_error);
4101 : Py_CLEAR(clear_module_state->__pyx_n_s_flags);
4102 : Py_CLEAR(clear_module_state->__pyx_n_s_float64);
4103 : Py_CLEAR(clear_module_state->__pyx_n_s_flow);
4104 : Py_CLEAR(clear_module_state->__pyx_n_s_flow_array);
4105 : Py_CLEAR(clear_module_state->__pyx_n_s_flow_matrix);
4106 : Py_CLEAR(clear_module_state->__pyx_n_s_flow_value);
4107 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
4108 : Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
4109 : Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
4110 : Py_CLEAR(clear_module_state->__pyx_n_s_from_scipy_sparse);
4111 : Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
4112 : Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
4113 : Py_CLEAR(clear_module_state->__pyx_kp_u_got);
4114 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4115 : Py_CLEAR(clear_module_state->__pyx_kp_u_graph_capacities_must_be_integer);
4116 : Py_CLEAR(clear_module_state->__pyx_kp_u_graph_must_be_in_CSR_format);
4117 : Py_CLEAR(clear_module_state->__pyx_kp_u_graph_must_be_specified_as_a_squ);
4118 : Py_CLEAR(clear_module_state->__pyx_n_s_has_sorted_indices);
4119 : Py_CLEAR(clear_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4120 : Py_CLEAR(clear_module_state->__pyx_n_s_i);
4121 : Py_CLEAR(clear_module_state->__pyx_n_s_id);
4122 : Py_CLEAR(clear_module_state->__pyx_n_s_iinfo);
4123 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
4124 : Py_CLEAR(clear_module_state->__pyx_n_s_index);
4125 : Py_CLEAR(clear_module_state->__pyx_n_s_indices);
4126 : Py_CLEAR(clear_module_state->__pyx_n_s_indptr);
4127 : Py_CLEAR(clear_module_state->__pyx_n_s_init);
4128 : Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
4129 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
4130 : Py_CLEAR(clear_module_state->__pyx_n_s_int32);
4131 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
4132 : Py_CLEAR(clear_module_state->__pyx_n_s_is_pydata_sparse);
4133 : Py_CLEAR(clear_module_state->__pyx_n_s_is_pydata_spmatrix);
4134 : Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
4135 : Py_CLEAR(clear_module_state->__pyx_n_s_issparse);
4136 : Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
4137 : Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4138 : Py_CLEAR(clear_module_state->__pyx_n_s_j);
4139 : Py_CLEAR(clear_module_state->__pyx_n_s_m);
4140 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
4141 : Py_CLEAR(clear_module_state->__pyx_n_s_make_edge_pointers);
4142 : Py_CLEAR(clear_module_state->__pyx_n_s_make_tails);
4143 : Py_CLEAR(clear_module_state->__pyx_n_s_max);
4144 : Py_CLEAR(clear_module_state->__pyx_n_s_maximum_flow);
4145 : Py_CLEAR(clear_module_state->__pyx_kp_u_maximum_flow_csgraph_source_sin);
4146 : Py_CLEAR(clear_module_state->__pyx_kp_u_maximum_flow_line_36);
4147 : Py_CLEAR(clear_module_state->__pyx_n_s_memview);
4148 : Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
4149 : Py_CLEAR(clear_module_state->__pyx_n_s_method);
4150 : Py_CLEAR(clear_module_state->__pyx_kp_u_method_is_not_supported_yet);
4151 : Py_CLEAR(clear_module_state->__pyx_n_s_mode);
4152 : Py_CLEAR(clear_module_state->__pyx_n_s_module);
4153 : Py_CLEAR(clear_module_state->__pyx_n_s_move_a);
4154 : Py_CLEAR(clear_module_state->__pyx_n_s_move_at);
4155 : Py_CLEAR(clear_module_state->__pyx_n_s_n);
4156 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
4157 : Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
4158 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
4159 : Py_CLEAR(clear_module_state->__pyx_n_s_new);
4160 : Py_CLEAR(clear_module_state->__pyx_n_s_nnz);
4161 : Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4162 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
4163 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
4164 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4165 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4166 : Py_CLEAR(clear_module_state->__pyx_n_s_obj);
4167 : Py_CLEAR(clear_module_state->__pyx_n_s_pack);
4168 : Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
4169 : Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
4170 : Py_CLEAR(clear_module_state->__pyx_n_s_pydata_sparse_cls);
4171 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
4172 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
4173 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
4174 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
4175 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
4176 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
4177 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
4178 : Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
4179 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
4180 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
4181 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
4182 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
4183 : Py_CLEAR(clear_module_state->__pyx_n_s_register);
4184 : Py_CLEAR(clear_module_state->__pyx_n_s_repr);
4185 : Py_CLEAR(clear_module_state->__pyx_n_s_res_data);
4186 : Py_CLEAR(clear_module_state->__pyx_n_s_res_data_view);
4187 : Py_CLEAR(clear_module_state->__pyx_n_s_res_indices);
4188 : Py_CLEAR(clear_module_state->__pyx_n_s_res_indices_view);
4189 : Py_CLEAR(clear_module_state->__pyx_n_s_res_indptr);
4190 : Py_CLEAR(clear_module_state->__pyx_n_s_res_indptr_view);
4191 : Py_CLEAR(clear_module_state->__pyx_n_s_res_ptr);
4192 : Py_CLEAR(clear_module_state->__pyx_n_s_rev_edge_ptr);
4193 : Py_CLEAR(clear_module_state->__pyx_n_s_safe_downcast_indices);
4194 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse);
4195 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse__sputils);
4196 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse_csgraph__flow);
4197 : Py_CLEAR(clear_module_state->__pyx_n_s_self);
4198 : Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
4199 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
4200 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
4201 : Py_CLEAR(clear_module_state->__pyx_n_s_shape);
4202 : Py_CLEAR(clear_module_state->__pyx_n_s_sink);
4203 : Py_CLEAR(clear_module_state->__pyx_kp_u_sink_value_must_be_between);
4204 : Py_CLEAR(clear_module_state->__pyx_n_s_size);
4205 : Py_CLEAR(clear_module_state->__pyx_n_s_sorted_indices);
4206 : Py_CLEAR(clear_module_state->__pyx_n_s_source);
4207 : Py_CLEAR(clear_module_state->__pyx_kp_u_source_and_sink_vertices_must_di);
4208 : Py_CLEAR(clear_module_state->__pyx_n_s_source_flow);
4209 : Py_CLEAR(clear_module_state->__pyx_kp_u_source_value_must_be_between);
4210 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
4211 : Py_CLEAR(clear_module_state->__pyx_n_s_start);
4212 : Py_CLEAR(clear_module_state->__pyx_n_s_step);
4213 : Py_CLEAR(clear_module_state->__pyx_n_s_stop);
4214 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
4215 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4216 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
4217 : Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
4218 : Py_CLEAR(clear_module_state->__pyx_n_s_struct);
4219 : Py_CLEAR(clear_module_state->__pyx_n_s_sum);
4220 : Py_CLEAR(clear_module_state->__pyx_n_s_super);
4221 : Py_CLEAR(clear_module_state->__pyx_n_s_sys);
4222 : Py_CLEAR(clear_module_state->__pyx_n_s_tails);
4223 : Py_CLEAR(clear_module_state->__pyx_n_s_target_format);
4224 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
4225 : Py_CLEAR(clear_module_state->__pyx_n_s_tools);
4226 : Py_CLEAR(clear_module_state->__pyx_n_s_transpose);
4227 : Py_CLEAR(clear_module_state->__pyx_n_s_type);
4228 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4229 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4230 : Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
4231 : Py_CLEAR(clear_module_state->__pyx_n_s_update);
4232 : Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
4233 : Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
4234 : Py_CLEAR(clear_module_state->__pyx_int_0);
4235 : Py_CLEAR(clear_module_state->__pyx_int_1);
4236 : Py_CLEAR(clear_module_state->__pyx_int_2);
4237 : Py_CLEAR(clear_module_state->__pyx_int_3);
4238 : Py_CLEAR(clear_module_state->__pyx_int_112105877);
4239 : Py_CLEAR(clear_module_state->__pyx_int_136983863);
4240 : Py_CLEAR(clear_module_state->__pyx_int_184977713);
4241 : Py_CLEAR(clear_module_state->__pyx_int_neg_1);
4242 : Py_CLEAR(clear_module_state->__pyx_slice__5);
4243 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
4244 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
4245 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
4246 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
4247 : Py_CLEAR(clear_module_state->__pyx_tuple__11);
4248 : Py_CLEAR(clear_module_state->__pyx_tuple__12);
4249 : Py_CLEAR(clear_module_state->__pyx_tuple__13);
4250 : Py_CLEAR(clear_module_state->__pyx_tuple__14);
4251 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
4252 : Py_CLEAR(clear_module_state->__pyx_tuple__16);
4253 : Py_CLEAR(clear_module_state->__pyx_tuple__17);
4254 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
4255 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
4256 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
4257 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
4258 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
4259 : Py_CLEAR(clear_module_state->__pyx_tuple__23);
4260 : Py_CLEAR(clear_module_state->__pyx_tuple__24);
4261 : Py_CLEAR(clear_module_state->__pyx_tuple__26);
4262 : Py_CLEAR(clear_module_state->__pyx_tuple__28);
4263 : Py_CLEAR(clear_module_state->__pyx_tuple__30);
4264 : Py_CLEAR(clear_module_state->__pyx_tuple__32);
4265 : Py_CLEAR(clear_module_state->__pyx_tuple__34);
4266 : Py_CLEAR(clear_module_state->__pyx_tuple__36);
4267 : Py_CLEAR(clear_module_state->__pyx_codeobj__25);
4268 : Py_CLEAR(clear_module_state->__pyx_codeobj__27);
4269 : Py_CLEAR(clear_module_state->__pyx_codeobj__29);
4270 : Py_CLEAR(clear_module_state->__pyx_codeobj__31);
4271 : Py_CLEAR(clear_module_state->__pyx_codeobj__33);
4272 : Py_CLEAR(clear_module_state->__pyx_codeobj__35);
4273 : Py_CLEAR(clear_module_state->__pyx_codeobj__37);
4274 : return 0;
4275 : }
4276 : #endif
4277 : /* #### Code section: module_state_traverse ### */
4278 : #if CYTHON_USE_MODULE_STATE
4279 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4280 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
4281 : if (!traverse_module_state) return 0;
4282 : Py_VISIT(traverse_module_state->__pyx_d);
4283 : Py_VISIT(traverse_module_state->__pyx_b);
4284 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4285 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
4286 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
4287 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
4288 : #ifdef __Pyx_CyFunction_USED
4289 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4290 : #endif
4291 : #ifdef __Pyx_FusedFunction_USED
4292 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
4293 : #endif
4294 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4295 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4296 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4297 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4298 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4299 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4300 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4301 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4302 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4303 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4304 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4305 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4306 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4307 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4308 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4309 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4310 : Py_VISIT(traverse_module_state->__pyx_array_type);
4311 : Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4312 : Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4313 : Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4314 : Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4315 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4316 : Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4317 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4318 : Py_VISIT(traverse_module_state->__pyx_kp_u_);
4319 : Py_VISIT(traverse_module_state->__pyx_kp_u_0_and);
4320 : Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
4321 : Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4322 : Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
4323 : Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4324 : Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4325 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4326 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4327 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
4328 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4329 : Py_VISIT(traverse_module_state->__pyx_n_s_DTYPE);
4330 : Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4331 : Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
4332 : Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4333 : Py_VISIT(traverse_module_state->__pyx_n_s_ITYPE);
4334 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
4335 : Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4336 : Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
4337 : Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4338 : Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4339 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4340 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4341 : Py_VISIT(traverse_module_state->__pyx_n_s_MaximumFlowResult);
4342 : Py_VISIT(traverse_module_state->__pyx_n_s_MaximumFlowResult___init);
4343 : Py_VISIT(traverse_module_state->__pyx_n_s_MaximumFlowResult___repr);
4344 : Py_VISIT(traverse_module_state->__pyx_kp_u_MaximumFlowResult_with_value_of);
4345 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
4346 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4347 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
4348 : Py_VISIT(traverse_module_state->__pyx_n_b_O);
4349 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4350 : Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
4351 : Py_VISIT(traverse_module_state->__pyx_kp_s_Represents_the_result_of_a_maxim);
4352 : Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
4353 : Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4354 : Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
4355 : Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4356 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
4357 : Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
4358 : Py_VISIT(traverse_module_state->__pyx_kp_u__2);
4359 : Py_VISIT(traverse_module_state->__pyx_n_s__3);
4360 : Py_VISIT(traverse_module_state->__pyx_n_s__38);
4361 : Py_VISIT(traverse_module_state->__pyx_kp_u__6);
4362 : Py_VISIT(traverse_module_state->__pyx_kp_u__7);
4363 : Py_VISIT(traverse_module_state->__pyx_n_s_a);
4364 : Py_VISIT(traverse_module_state->__pyx_n_s_a_data_view);
4365 : Py_VISIT(traverse_module_state->__pyx_n_s_a_end);
4366 : Py_VISIT(traverse_module_state->__pyx_n_s_a_indices_view);
4367 : Py_VISIT(traverse_module_state->__pyx_n_s_a_indptr_view);
4368 : Py_VISIT(traverse_module_state->__pyx_n_s_a_ptr);
4369 : Py_VISIT(traverse_module_state->__pyx_n_s_abc);
4370 : Py_VISIT(traverse_module_state->__pyx_n_s_add_reverse_edges);
4371 : Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
4372 : Py_VISIT(traverse_module_state->__pyx_kp_u_and);
4373 : Py_VISIT(traverse_module_state->__pyx_n_s_arange);
4374 : Py_VISIT(traverse_module_state->__pyx_n_s_asarray);
4375 : Py_VISIT(traverse_module_state->__pyx_n_s_astype);
4376 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
4377 : Py_VISIT(traverse_module_state->__pyx_n_s_at);
4378 : Py_VISIT(traverse_module_state->__pyx_n_s_at_end);
4379 : Py_VISIT(traverse_module_state->__pyx_n_s_at_indices_view);
4380 : Py_VISIT(traverse_module_state->__pyx_n_s_at_indptr_view);
4381 : Py_VISIT(traverse_module_state->__pyx_n_s_at_ptr);
4382 : Py_VISIT(traverse_module_state->__pyx_n_s_b);
4383 : Py_VISIT(traverse_module_state->__pyx_n_s_b_data);
4384 : Py_VISIT(traverse_module_state->__pyx_n_s_base);
4385 : Py_VISIT(traverse_module_state->__pyx_n_s_c);
4386 : Py_VISIT(traverse_module_state->__pyx_n_u_c);
4387 : Py_VISIT(traverse_module_state->__pyx_n_s_class);
4388 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
4389 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
4390 : Py_VISIT(traverse_module_state->__pyx_n_s_collections);
4391 : Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
4392 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
4393 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
4394 : Py_VISIT(traverse_module_state->__pyx_n_s_convert_pydata_sparse_to_scipy);
4395 : Py_VISIT(traverse_module_state->__pyx_n_s_count);
4396 : Py_VISIT(traverse_module_state->__pyx_n_s_csgraph);
4397 : Py_VISIT(traverse_module_state->__pyx_n_s_csgraph_indices);
4398 : Py_VISIT(traverse_module_state->__pyx_n_s_csgraph_indptr);
4399 : Py_VISIT(traverse_module_state->__pyx_n_s_csgraph_orig);
4400 : Py_VISIT(traverse_module_state->__pyx_n_u_csr);
4401 : Py_VISIT(traverse_module_state->__pyx_n_s_csr_array);
4402 : Py_VISIT(traverse_module_state->__pyx_n_s_csr_matrix);
4403 : Py_VISIT(traverse_module_state->__pyx_n_s_data);
4404 : Py_VISIT(traverse_module_state->__pyx_n_s_dict);
4405 : Py_VISIT(traverse_module_state->__pyx_n_u_dinic);
4406 : Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
4407 : Py_VISIT(traverse_module_state->__pyx_n_s_doc);
4408 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
4409 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
4410 : Py_VISIT(traverse_module_state->__pyx_n_u_edmonds_karp);
4411 : Py_VISIT(traverse_module_state->__pyx_n_s_empty);
4412 : Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
4413 : Py_VISIT(traverse_module_state->__pyx_n_s_encode);
4414 : Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
4415 : Py_VISIT(traverse_module_state->__pyx_n_s_error);
4416 : Py_VISIT(traverse_module_state->__pyx_n_s_flags);
4417 : Py_VISIT(traverse_module_state->__pyx_n_s_float64);
4418 : Py_VISIT(traverse_module_state->__pyx_n_s_flow);
4419 : Py_VISIT(traverse_module_state->__pyx_n_s_flow_array);
4420 : Py_VISIT(traverse_module_state->__pyx_n_s_flow_matrix);
4421 : Py_VISIT(traverse_module_state->__pyx_n_s_flow_value);
4422 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
4423 : Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
4424 : Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
4425 : Py_VISIT(traverse_module_state->__pyx_n_s_from_scipy_sparse);
4426 : Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
4427 : Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
4428 : Py_VISIT(traverse_module_state->__pyx_kp_u_got);
4429 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4430 : Py_VISIT(traverse_module_state->__pyx_kp_u_graph_capacities_must_be_integer);
4431 : Py_VISIT(traverse_module_state->__pyx_kp_u_graph_must_be_in_CSR_format);
4432 : Py_VISIT(traverse_module_state->__pyx_kp_u_graph_must_be_specified_as_a_squ);
4433 : Py_VISIT(traverse_module_state->__pyx_n_s_has_sorted_indices);
4434 : Py_VISIT(traverse_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4435 : Py_VISIT(traverse_module_state->__pyx_n_s_i);
4436 : Py_VISIT(traverse_module_state->__pyx_n_s_id);
4437 : Py_VISIT(traverse_module_state->__pyx_n_s_iinfo);
4438 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
4439 : Py_VISIT(traverse_module_state->__pyx_n_s_index);
4440 : Py_VISIT(traverse_module_state->__pyx_n_s_indices);
4441 : Py_VISIT(traverse_module_state->__pyx_n_s_indptr);
4442 : Py_VISIT(traverse_module_state->__pyx_n_s_init);
4443 : Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
4444 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
4445 : Py_VISIT(traverse_module_state->__pyx_n_s_int32);
4446 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
4447 : Py_VISIT(traverse_module_state->__pyx_n_s_is_pydata_sparse);
4448 : Py_VISIT(traverse_module_state->__pyx_n_s_is_pydata_spmatrix);
4449 : Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
4450 : Py_VISIT(traverse_module_state->__pyx_n_s_issparse);
4451 : Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
4452 : Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4453 : Py_VISIT(traverse_module_state->__pyx_n_s_j);
4454 : Py_VISIT(traverse_module_state->__pyx_n_s_m);
4455 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
4456 : Py_VISIT(traverse_module_state->__pyx_n_s_make_edge_pointers);
4457 : Py_VISIT(traverse_module_state->__pyx_n_s_make_tails);
4458 : Py_VISIT(traverse_module_state->__pyx_n_s_max);
4459 : Py_VISIT(traverse_module_state->__pyx_n_s_maximum_flow);
4460 : Py_VISIT(traverse_module_state->__pyx_kp_u_maximum_flow_csgraph_source_sin);
4461 : Py_VISIT(traverse_module_state->__pyx_kp_u_maximum_flow_line_36);
4462 : Py_VISIT(traverse_module_state->__pyx_n_s_memview);
4463 : Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
4464 : Py_VISIT(traverse_module_state->__pyx_n_s_method);
4465 : Py_VISIT(traverse_module_state->__pyx_kp_u_method_is_not_supported_yet);
4466 : Py_VISIT(traverse_module_state->__pyx_n_s_mode);
4467 : Py_VISIT(traverse_module_state->__pyx_n_s_module);
4468 : Py_VISIT(traverse_module_state->__pyx_n_s_move_a);
4469 : Py_VISIT(traverse_module_state->__pyx_n_s_move_at);
4470 : Py_VISIT(traverse_module_state->__pyx_n_s_n);
4471 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
4472 : Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
4473 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
4474 : Py_VISIT(traverse_module_state->__pyx_n_s_new);
4475 : Py_VISIT(traverse_module_state->__pyx_n_s_nnz);
4476 : Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4477 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
4478 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
4479 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4480 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4481 : Py_VISIT(traverse_module_state->__pyx_n_s_obj);
4482 : Py_VISIT(traverse_module_state->__pyx_n_s_pack);
4483 : Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
4484 : Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
4485 : Py_VISIT(traverse_module_state->__pyx_n_s_pydata_sparse_cls);
4486 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
4487 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
4488 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
4489 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
4490 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
4491 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
4492 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
4493 : Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
4494 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
4495 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
4496 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
4497 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
4498 : Py_VISIT(traverse_module_state->__pyx_n_s_register);
4499 : Py_VISIT(traverse_module_state->__pyx_n_s_repr);
4500 : Py_VISIT(traverse_module_state->__pyx_n_s_res_data);
4501 : Py_VISIT(traverse_module_state->__pyx_n_s_res_data_view);
4502 : Py_VISIT(traverse_module_state->__pyx_n_s_res_indices);
4503 : Py_VISIT(traverse_module_state->__pyx_n_s_res_indices_view);
4504 : Py_VISIT(traverse_module_state->__pyx_n_s_res_indptr);
4505 : Py_VISIT(traverse_module_state->__pyx_n_s_res_indptr_view);
4506 : Py_VISIT(traverse_module_state->__pyx_n_s_res_ptr);
4507 : Py_VISIT(traverse_module_state->__pyx_n_s_rev_edge_ptr);
4508 : Py_VISIT(traverse_module_state->__pyx_n_s_safe_downcast_indices);
4509 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse);
4510 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse__sputils);
4511 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse_csgraph__flow);
4512 : Py_VISIT(traverse_module_state->__pyx_n_s_self);
4513 : Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
4514 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
4515 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
4516 : Py_VISIT(traverse_module_state->__pyx_n_s_shape);
4517 : Py_VISIT(traverse_module_state->__pyx_n_s_sink);
4518 : Py_VISIT(traverse_module_state->__pyx_kp_u_sink_value_must_be_between);
4519 : Py_VISIT(traverse_module_state->__pyx_n_s_size);
4520 : Py_VISIT(traverse_module_state->__pyx_n_s_sorted_indices);
4521 : Py_VISIT(traverse_module_state->__pyx_n_s_source);
4522 : Py_VISIT(traverse_module_state->__pyx_kp_u_source_and_sink_vertices_must_di);
4523 : Py_VISIT(traverse_module_state->__pyx_n_s_source_flow);
4524 : Py_VISIT(traverse_module_state->__pyx_kp_u_source_value_must_be_between);
4525 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
4526 : Py_VISIT(traverse_module_state->__pyx_n_s_start);
4527 : Py_VISIT(traverse_module_state->__pyx_n_s_step);
4528 : Py_VISIT(traverse_module_state->__pyx_n_s_stop);
4529 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
4530 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4531 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
4532 : Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
4533 : Py_VISIT(traverse_module_state->__pyx_n_s_struct);
4534 : Py_VISIT(traverse_module_state->__pyx_n_s_sum);
4535 : Py_VISIT(traverse_module_state->__pyx_n_s_super);
4536 : Py_VISIT(traverse_module_state->__pyx_n_s_sys);
4537 : Py_VISIT(traverse_module_state->__pyx_n_s_tails);
4538 : Py_VISIT(traverse_module_state->__pyx_n_s_target_format);
4539 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
4540 : Py_VISIT(traverse_module_state->__pyx_n_s_tools);
4541 : Py_VISIT(traverse_module_state->__pyx_n_s_transpose);
4542 : Py_VISIT(traverse_module_state->__pyx_n_s_type);
4543 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4544 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4545 : Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
4546 : Py_VISIT(traverse_module_state->__pyx_n_s_update);
4547 : Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
4548 : Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
4549 : Py_VISIT(traverse_module_state->__pyx_int_0);
4550 : Py_VISIT(traverse_module_state->__pyx_int_1);
4551 : Py_VISIT(traverse_module_state->__pyx_int_2);
4552 : Py_VISIT(traverse_module_state->__pyx_int_3);
4553 : Py_VISIT(traverse_module_state->__pyx_int_112105877);
4554 : Py_VISIT(traverse_module_state->__pyx_int_136983863);
4555 : Py_VISIT(traverse_module_state->__pyx_int_184977713);
4556 : Py_VISIT(traverse_module_state->__pyx_int_neg_1);
4557 : Py_VISIT(traverse_module_state->__pyx_slice__5);
4558 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
4559 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
4560 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
4561 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
4562 : Py_VISIT(traverse_module_state->__pyx_tuple__11);
4563 : Py_VISIT(traverse_module_state->__pyx_tuple__12);
4564 : Py_VISIT(traverse_module_state->__pyx_tuple__13);
4565 : Py_VISIT(traverse_module_state->__pyx_tuple__14);
4566 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
4567 : Py_VISIT(traverse_module_state->__pyx_tuple__16);
4568 : Py_VISIT(traverse_module_state->__pyx_tuple__17);
4569 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
4570 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
4571 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
4572 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
4573 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
4574 : Py_VISIT(traverse_module_state->__pyx_tuple__23);
4575 : Py_VISIT(traverse_module_state->__pyx_tuple__24);
4576 : Py_VISIT(traverse_module_state->__pyx_tuple__26);
4577 : Py_VISIT(traverse_module_state->__pyx_tuple__28);
4578 : Py_VISIT(traverse_module_state->__pyx_tuple__30);
4579 : Py_VISIT(traverse_module_state->__pyx_tuple__32);
4580 : Py_VISIT(traverse_module_state->__pyx_tuple__34);
4581 : Py_VISIT(traverse_module_state->__pyx_tuple__36);
4582 : Py_VISIT(traverse_module_state->__pyx_codeobj__25);
4583 : Py_VISIT(traverse_module_state->__pyx_codeobj__27);
4584 : Py_VISIT(traverse_module_state->__pyx_codeobj__29);
4585 : Py_VISIT(traverse_module_state->__pyx_codeobj__31);
4586 : Py_VISIT(traverse_module_state->__pyx_codeobj__33);
4587 : Py_VISIT(traverse_module_state->__pyx_codeobj__35);
4588 : Py_VISIT(traverse_module_state->__pyx_codeobj__37);
4589 : return 0;
4590 : }
4591 : #endif
4592 : /* #### Code section: module_state_defines ### */
4593 : #define __pyx_d __pyx_mstate_global->__pyx_d
4594 : #define __pyx_b __pyx_mstate_global->__pyx_b
4595 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
4596 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
4597 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
4598 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
4599 : #ifdef __Pyx_CyFunction_USED
4600 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
4601 : #endif
4602 : #ifdef __Pyx_FusedFunction_USED
4603 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
4604 : #endif
4605 : #ifdef __Pyx_Generator_USED
4606 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
4607 : #endif
4608 : #ifdef __Pyx_IterableCoroutine_USED
4609 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
4610 : #endif
4611 : #ifdef __Pyx_Coroutine_USED
4612 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
4613 : #endif
4614 : #ifdef __Pyx_Coroutine_USED
4615 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
4616 : #endif
4617 : #if CYTHON_USE_MODULE_STATE
4618 : #endif
4619 : #if CYTHON_USE_MODULE_STATE
4620 : #endif
4621 : #if CYTHON_USE_MODULE_STATE
4622 : #endif
4623 : #if CYTHON_USE_MODULE_STATE
4624 : #endif
4625 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
4626 : #if CYTHON_USE_MODULE_STATE
4627 : #endif
4628 : #if CYTHON_USE_MODULE_STATE
4629 : #endif
4630 : #if CYTHON_USE_MODULE_STATE
4631 : #endif
4632 : #if CYTHON_USE_MODULE_STATE
4633 : #endif
4634 : #if CYTHON_USE_MODULE_STATE
4635 : #endif
4636 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
4637 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
4638 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
4639 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
4640 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
4641 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
4642 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
4643 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
4644 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
4645 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
4646 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
4647 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
4648 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
4649 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
4650 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
4651 : #if CYTHON_USE_MODULE_STATE
4652 : #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
4653 : #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
4654 : #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
4655 : #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
4656 : #endif
4657 : #define __pyx_array_type __pyx_mstate_global->__pyx_array_type
4658 : #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
4659 : #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
4660 : #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
4661 : #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
4662 : #define __pyx_kp_u_0_and __pyx_mstate_global->__pyx_kp_u_0_and
4663 : #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
4664 : #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
4665 : #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
4666 : #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
4667 : #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
4668 : #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
4669 : #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
4670 : #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
4671 : #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
4672 : #define __pyx_n_s_DTYPE __pyx_mstate_global->__pyx_n_s_DTYPE
4673 : #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
4674 : #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
4675 : #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
4676 : #define __pyx_n_s_ITYPE __pyx_mstate_global->__pyx_n_s_ITYPE
4677 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
4678 : #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
4679 : #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
4680 : #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
4681 : #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
4682 : #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
4683 : #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
4684 : #define __pyx_n_s_MaximumFlowResult __pyx_mstate_global->__pyx_n_s_MaximumFlowResult
4685 : #define __pyx_n_s_MaximumFlowResult___init __pyx_mstate_global->__pyx_n_s_MaximumFlowResult___init
4686 : #define __pyx_n_s_MaximumFlowResult___repr __pyx_mstate_global->__pyx_n_s_MaximumFlowResult___repr
4687 : #define __pyx_kp_u_MaximumFlowResult_with_value_of __pyx_mstate_global->__pyx_kp_u_MaximumFlowResult_with_value_of
4688 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
4689 : #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
4690 : #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
4691 : #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
4692 : #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
4693 : #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
4694 : #define __pyx_kp_s_Represents_the_result_of_a_maxim __pyx_mstate_global->__pyx_kp_s_Represents_the_result_of_a_maxim
4695 : #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
4696 : #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
4697 : #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
4698 : #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
4699 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
4700 : #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
4701 : #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
4702 : #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
4703 : #define __pyx_n_s__38 __pyx_mstate_global->__pyx_n_s__38
4704 : #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
4705 : #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
4706 : #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a
4707 : #define __pyx_n_s_a_data_view __pyx_mstate_global->__pyx_n_s_a_data_view
4708 : #define __pyx_n_s_a_end __pyx_mstate_global->__pyx_n_s_a_end
4709 : #define __pyx_n_s_a_indices_view __pyx_mstate_global->__pyx_n_s_a_indices_view
4710 : #define __pyx_n_s_a_indptr_view __pyx_mstate_global->__pyx_n_s_a_indptr_view
4711 : #define __pyx_n_s_a_ptr __pyx_mstate_global->__pyx_n_s_a_ptr
4712 : #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
4713 : #define __pyx_n_s_add_reverse_edges __pyx_mstate_global->__pyx_n_s_add_reverse_edges
4714 : #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
4715 : #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
4716 : #define __pyx_n_s_arange __pyx_mstate_global->__pyx_n_s_arange
4717 : #define __pyx_n_s_asarray __pyx_mstate_global->__pyx_n_s_asarray
4718 : #define __pyx_n_s_astype __pyx_mstate_global->__pyx_n_s_astype
4719 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
4720 : #define __pyx_n_s_at __pyx_mstate_global->__pyx_n_s_at
4721 : #define __pyx_n_s_at_end __pyx_mstate_global->__pyx_n_s_at_end
4722 : #define __pyx_n_s_at_indices_view __pyx_mstate_global->__pyx_n_s_at_indices_view
4723 : #define __pyx_n_s_at_indptr_view __pyx_mstate_global->__pyx_n_s_at_indptr_view
4724 : #define __pyx_n_s_at_ptr __pyx_mstate_global->__pyx_n_s_at_ptr
4725 : #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b
4726 : #define __pyx_n_s_b_data __pyx_mstate_global->__pyx_n_s_b_data
4727 : #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
4728 : #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
4729 : #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
4730 : #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
4731 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
4732 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
4733 : #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
4734 : #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
4735 : #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
4736 : #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
4737 : #define __pyx_n_s_convert_pydata_sparse_to_scipy __pyx_mstate_global->__pyx_n_s_convert_pydata_sparse_to_scipy
4738 : #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
4739 : #define __pyx_n_s_csgraph __pyx_mstate_global->__pyx_n_s_csgraph
4740 : #define __pyx_n_s_csgraph_indices __pyx_mstate_global->__pyx_n_s_csgraph_indices
4741 : #define __pyx_n_s_csgraph_indptr __pyx_mstate_global->__pyx_n_s_csgraph_indptr
4742 : #define __pyx_n_s_csgraph_orig __pyx_mstate_global->__pyx_n_s_csgraph_orig
4743 : #define __pyx_n_u_csr __pyx_mstate_global->__pyx_n_u_csr
4744 : #define __pyx_n_s_csr_array __pyx_mstate_global->__pyx_n_s_csr_array
4745 : #define __pyx_n_s_csr_matrix __pyx_mstate_global->__pyx_n_s_csr_matrix
4746 : #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
4747 : #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
4748 : #define __pyx_n_u_dinic __pyx_mstate_global->__pyx_n_u_dinic
4749 : #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
4750 : #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
4751 : #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
4752 : #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
4753 : #define __pyx_n_u_edmonds_karp __pyx_mstate_global->__pyx_n_u_edmonds_karp
4754 : #define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty
4755 : #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
4756 : #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
4757 : #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
4758 : #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
4759 : #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
4760 : #define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64
4761 : #define __pyx_n_s_flow __pyx_mstate_global->__pyx_n_s_flow
4762 : #define __pyx_n_s_flow_array __pyx_mstate_global->__pyx_n_s_flow_array
4763 : #define __pyx_n_s_flow_matrix __pyx_mstate_global->__pyx_n_s_flow_matrix
4764 : #define __pyx_n_s_flow_value __pyx_mstate_global->__pyx_n_s_flow_value
4765 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
4766 : #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
4767 : #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
4768 : #define __pyx_n_s_from_scipy_sparse __pyx_mstate_global->__pyx_n_s_from_scipy_sparse
4769 : #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
4770 : #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
4771 : #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
4772 : #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
4773 : #define __pyx_kp_u_graph_capacities_must_be_integer __pyx_mstate_global->__pyx_kp_u_graph_capacities_must_be_integer
4774 : #define __pyx_kp_u_graph_must_be_in_CSR_format __pyx_mstate_global->__pyx_kp_u_graph_must_be_in_CSR_format
4775 : #define __pyx_kp_u_graph_must_be_specified_as_a_squ __pyx_mstate_global->__pyx_kp_u_graph_must_be_specified_as_a_squ
4776 : #define __pyx_n_s_has_sorted_indices __pyx_mstate_global->__pyx_n_s_has_sorted_indices
4777 : #define __pyx_kp_s_home_czgdp18079_Quansight_scipy __pyx_mstate_global->__pyx_kp_s_home_czgdp18079_Quansight_scipy
4778 : #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
4779 : #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
4780 : #define __pyx_n_s_iinfo __pyx_mstate_global->__pyx_n_s_iinfo
4781 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
4782 : #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
4783 : #define __pyx_n_s_indices __pyx_mstate_global->__pyx_n_s_indices
4784 : #define __pyx_n_s_indptr __pyx_mstate_global->__pyx_n_s_indptr
4785 : #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init
4786 : #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
4787 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
4788 : #define __pyx_n_s_int32 __pyx_mstate_global->__pyx_n_s_int32
4789 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
4790 : #define __pyx_n_s_is_pydata_sparse __pyx_mstate_global->__pyx_n_s_is_pydata_sparse
4791 : #define __pyx_n_s_is_pydata_spmatrix __pyx_mstate_global->__pyx_n_s_is_pydata_spmatrix
4792 : #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
4793 : #define __pyx_n_s_issparse __pyx_mstate_global->__pyx_n_s_issparse
4794 : #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
4795 : #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
4796 : #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
4797 : #define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
4798 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
4799 : #define __pyx_n_s_make_edge_pointers __pyx_mstate_global->__pyx_n_s_make_edge_pointers
4800 : #define __pyx_n_s_make_tails __pyx_mstate_global->__pyx_n_s_make_tails
4801 : #define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max
4802 : #define __pyx_n_s_maximum_flow __pyx_mstate_global->__pyx_n_s_maximum_flow
4803 : #define __pyx_kp_u_maximum_flow_csgraph_source_sin __pyx_mstate_global->__pyx_kp_u_maximum_flow_csgraph_source_sin
4804 : #define __pyx_kp_u_maximum_flow_line_36 __pyx_mstate_global->__pyx_kp_u_maximum_flow_line_36
4805 : #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
4806 : #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
4807 : #define __pyx_n_s_method __pyx_mstate_global->__pyx_n_s_method
4808 : #define __pyx_kp_u_method_is_not_supported_yet __pyx_mstate_global->__pyx_kp_u_method_is_not_supported_yet
4809 : #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
4810 : #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
4811 : #define __pyx_n_s_move_a __pyx_mstate_global->__pyx_n_s_move_a
4812 : #define __pyx_n_s_move_at __pyx_mstate_global->__pyx_n_s_move_at
4813 : #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n
4814 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
4815 : #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
4816 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
4817 : #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
4818 : #define __pyx_n_s_nnz __pyx_mstate_global->__pyx_n_s_nnz
4819 : #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
4820 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
4821 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
4822 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
4823 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
4824 : #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
4825 : #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
4826 : #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
4827 : #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
4828 : #define __pyx_n_s_pydata_sparse_cls __pyx_mstate_global->__pyx_n_s_pydata_sparse_cls
4829 : #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
4830 : #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
4831 : #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
4832 : #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
4833 : #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
4834 : #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
4835 : #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
4836 : #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
4837 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
4838 : #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
4839 : #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
4840 : #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
4841 : #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
4842 : #define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr
4843 : #define __pyx_n_s_res_data __pyx_mstate_global->__pyx_n_s_res_data
4844 : #define __pyx_n_s_res_data_view __pyx_mstate_global->__pyx_n_s_res_data_view
4845 : #define __pyx_n_s_res_indices __pyx_mstate_global->__pyx_n_s_res_indices
4846 : #define __pyx_n_s_res_indices_view __pyx_mstate_global->__pyx_n_s_res_indices_view
4847 : #define __pyx_n_s_res_indptr __pyx_mstate_global->__pyx_n_s_res_indptr
4848 : #define __pyx_n_s_res_indptr_view __pyx_mstate_global->__pyx_n_s_res_indptr_view
4849 : #define __pyx_n_s_res_ptr __pyx_mstate_global->__pyx_n_s_res_ptr
4850 : #define __pyx_n_s_rev_edge_ptr __pyx_mstate_global->__pyx_n_s_rev_edge_ptr
4851 : #define __pyx_n_s_safe_downcast_indices __pyx_mstate_global->__pyx_n_s_safe_downcast_indices
4852 : #define __pyx_n_s_scipy_sparse __pyx_mstate_global->__pyx_n_s_scipy_sparse
4853 : #define __pyx_n_s_scipy_sparse__sputils __pyx_mstate_global->__pyx_n_s_scipy_sparse__sputils
4854 : #define __pyx_n_s_scipy_sparse_csgraph__flow __pyx_mstate_global->__pyx_n_s_scipy_sparse_csgraph__flow
4855 : #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
4856 : #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
4857 : #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
4858 : #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
4859 : #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
4860 : #define __pyx_n_s_sink __pyx_mstate_global->__pyx_n_s_sink
4861 : #define __pyx_kp_u_sink_value_must_be_between __pyx_mstate_global->__pyx_kp_u_sink_value_must_be_between
4862 : #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
4863 : #define __pyx_n_s_sorted_indices __pyx_mstate_global->__pyx_n_s_sorted_indices
4864 : #define __pyx_n_s_source __pyx_mstate_global->__pyx_n_s_source
4865 : #define __pyx_kp_u_source_and_sink_vertices_must_di __pyx_mstate_global->__pyx_kp_u_source_and_sink_vertices_must_di
4866 : #define __pyx_n_s_source_flow __pyx_mstate_global->__pyx_n_s_source_flow
4867 : #define __pyx_kp_u_source_value_must_be_between __pyx_mstate_global->__pyx_kp_u_source_value_must_be_between
4868 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
4869 : #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
4870 : #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
4871 : #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
4872 : #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
4873 : #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
4874 : #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
4875 : #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
4876 : #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
4877 : #define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum
4878 : #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
4879 : #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
4880 : #define __pyx_n_s_tails __pyx_mstate_global->__pyx_n_s_tails
4881 : #define __pyx_n_s_target_format __pyx_mstate_global->__pyx_n_s_target_format
4882 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
4883 : #define __pyx_n_s_tools __pyx_mstate_global->__pyx_n_s_tools
4884 : #define __pyx_n_s_transpose __pyx_mstate_global->__pyx_n_s_transpose
4885 : #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type
4886 : #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
4887 : #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
4888 : #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
4889 : #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
4890 : #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
4891 : #define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
4892 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
4893 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
4894 : #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
4895 : #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
4896 : #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
4897 : #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
4898 : #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
4899 : #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
4900 : #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
4901 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
4902 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
4903 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
4904 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
4905 : #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
4906 : #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
4907 : #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
4908 : #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
4909 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
4910 : #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
4911 : #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
4912 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
4913 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
4914 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
4915 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
4916 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
4917 : #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
4918 : #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
4919 : #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
4920 : #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
4921 : #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
4922 : #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
4923 : #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
4924 : #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
4925 : #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25
4926 : #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
4927 : #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
4928 : #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31
4929 : #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33
4930 : #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35
4931 : #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
4932 : /* #### Code section: module_code ### */
4933 :
4934 : /* "View.MemoryView":131
4935 : * cdef bint dtype_is_object
4936 : *
4937 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4938 : * mode="c", bint allocate_buffer=True):
4939 : *
4940 : */
4941 :
4942 : /* Python wrapper */
4943 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4944 0 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4945 0 : PyObject *__pyx_v_shape = 0;
4946 0 : Py_ssize_t __pyx_v_itemsize;
4947 0 : PyObject *__pyx_v_format = 0;
4948 0 : PyObject *__pyx_v_mode = 0;
4949 0 : int __pyx_v_allocate_buffer;
4950 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4951 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4952 0 : PyObject* values[5] = {0,0,0,0,0};
4953 0 : int __pyx_lineno = 0;
4954 0 : const char *__pyx_filename = NULL;
4955 0 : int __pyx_clineno = 0;
4956 0 : int __pyx_r;
4957 : __Pyx_RefNannyDeclarations
4958 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4959 : #if CYTHON_ASSUME_SAFE_MACROS
4960 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4961 : #else
4962 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4963 : #endif
4964 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
4965 : {
4966 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
4967 0 : values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
4968 0 : if (__pyx_kwds) {
4969 0 : Py_ssize_t kw_args;
4970 0 : switch (__pyx_nargs) {
4971 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
4972 0 : CYTHON_FALLTHROUGH;
4973 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
4974 0 : CYTHON_FALLTHROUGH;
4975 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
4976 0 : CYTHON_FALLTHROUGH;
4977 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
4978 0 : CYTHON_FALLTHROUGH;
4979 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
4980 0 : CYTHON_FALLTHROUGH;
4981 0 : case 0: break;
4982 0 : default: goto __pyx_L5_argtuple_error;
4983 : }
4984 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
4985 0 : switch (__pyx_nargs) {
4986 0 : case 0:
4987 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
4988 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
4989 0 : kw_args--;
4990 : }
4991 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4992 0 : else goto __pyx_L5_argtuple_error;
4993 0 : CYTHON_FALLTHROUGH;
4994 : case 1:
4995 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
4996 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
4997 0 : kw_args--;
4998 : }
4999 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5000 : else {
5001 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
5002 : }
5003 0 : CYTHON_FALLTHROUGH;
5004 : case 2:
5005 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
5006 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
5007 0 : kw_args--;
5008 : }
5009 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5010 : else {
5011 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
5012 : }
5013 0 : CYTHON_FALLTHROUGH;
5014 : case 3:
5015 0 : if (kw_args > 0) {
5016 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
5017 0 : if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5018 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5019 : }
5020 0 : CYTHON_FALLTHROUGH;
5021 : case 4:
5022 0 : if (kw_args > 0) {
5023 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
5024 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5025 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5026 : }
5027 : }
5028 0 : if (unlikely(kw_args > 0)) {
5029 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
5030 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
5031 : }
5032 : } else {
5033 0 : switch (__pyx_nargs) {
5034 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
5035 0 : CYTHON_FALLTHROUGH;
5036 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
5037 0 : CYTHON_FALLTHROUGH;
5038 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
5039 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
5040 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
5041 0 : break;
5042 0 : default: goto __pyx_L5_argtuple_error;
5043 : }
5044 : }
5045 0 : __pyx_v_shape = ((PyObject*)values[0]);
5046 0 : __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5047 0 : __pyx_v_format = values[2];
5048 0 : __pyx_v_mode = values[3];
5049 0 : if (values[4]) {
5050 0 : __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
5051 : } else {
5052 :
5053 : /* "View.MemoryView":132
5054 : *
5055 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5056 : * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
5057 : *
5058 : * cdef int idx
5059 : */
5060 : __pyx_v_allocate_buffer = ((int)1);
5061 : }
5062 : }
5063 0 : goto __pyx_L6_skip;
5064 0 : __pyx_L5_argtuple_error:;
5065 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
5066 0 : __pyx_L6_skip:;
5067 0 : goto __pyx_L4_argument_unpacking_done;
5068 0 : __pyx_L3_error:;
5069 : {
5070 0 : Py_ssize_t __pyx_temp;
5071 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5072 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5073 : }
5074 : }
5075 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5076 0 : __Pyx_RefNannyFinishContext();
5077 0 : return -1;
5078 0 : __pyx_L4_argument_unpacking_done:;
5079 0 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
5080 0 : if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5081 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
5082 : }
5083 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
5084 :
5085 : /* "View.MemoryView":131
5086 : * cdef bint dtype_is_object
5087 : *
5088 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5089 : * mode="c", bint allocate_buffer=True):
5090 : *
5091 : */
5092 :
5093 : /* function exit code */
5094 0 : goto __pyx_L0;
5095 : __pyx_L1_error:;
5096 : __pyx_r = -1;
5097 0 : __pyx_L0:;
5098 : {
5099 0 : Py_ssize_t __pyx_temp;
5100 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5101 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5102 : }
5103 : }
5104 : __Pyx_RefNannyFinishContext();
5105 : return __pyx_r;
5106 : }
5107 :
5108 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
5109 0 : int __pyx_v_idx;
5110 0 : Py_ssize_t __pyx_v_dim;
5111 0 : char __pyx_v_order;
5112 0 : int __pyx_r;
5113 : __Pyx_RefNannyDeclarations
5114 0 : Py_ssize_t __pyx_t_1;
5115 0 : int __pyx_t_2;
5116 0 : int __pyx_t_3;
5117 0 : PyObject *__pyx_t_4 = NULL;
5118 0 : PyObject *__pyx_t_5 = NULL;
5119 0 : PyObject *__pyx_t_6 = NULL;
5120 0 : unsigned int __pyx_t_7;
5121 0 : char *__pyx_t_8;
5122 0 : int __pyx_t_9;
5123 0 : Py_ssize_t __pyx_t_10;
5124 0 : Py_UCS4 __pyx_t_11;
5125 0 : int __pyx_lineno = 0;
5126 0 : const char *__pyx_filename = NULL;
5127 0 : int __pyx_clineno = 0;
5128 0 : __Pyx_RefNannySetupContext("__cinit__", 0);
5129 0 : __Pyx_INCREF(__pyx_v_format);
5130 :
5131 : /* "View.MemoryView":137
5132 : * cdef Py_ssize_t dim
5133 : *
5134 : * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
5135 : * self.itemsize = itemsize
5136 : *
5137 : */
5138 0 : if (unlikely(__pyx_v_shape == Py_None)) {
5139 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5140 0 : __PYX_ERR(1, 137, __pyx_L1_error)
5141 : }
5142 0 : __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
5143 0 : __pyx_v_self->ndim = ((int)__pyx_t_1);
5144 :
5145 : /* "View.MemoryView":138
5146 : *
5147 : * self.ndim = <int> len(shape)
5148 : * self.itemsize = itemsize # <<<<<<<<<<<<<<
5149 : *
5150 : * if not self.ndim:
5151 : */
5152 0 : __pyx_v_self->itemsize = __pyx_v_itemsize;
5153 :
5154 : /* "View.MemoryView":140
5155 : * self.itemsize = itemsize
5156 : *
5157 : * if not self.ndim: # <<<<<<<<<<<<<<
5158 : * raise ValueError, "Empty shape tuple for cython.array"
5159 : *
5160 : */
5161 0 : __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
5162 0 : if (unlikely(__pyx_t_2)) {
5163 :
5164 : /* "View.MemoryView":141
5165 : *
5166 : * if not self.ndim:
5167 : * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
5168 : *
5169 : * if itemsize <= 0:
5170 : */
5171 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
5172 0 : __PYX_ERR(1, 141, __pyx_L1_error)
5173 :
5174 : /* "View.MemoryView":140
5175 : * self.itemsize = itemsize
5176 : *
5177 : * if not self.ndim: # <<<<<<<<<<<<<<
5178 : * raise ValueError, "Empty shape tuple for cython.array"
5179 : *
5180 : */
5181 : }
5182 :
5183 : /* "View.MemoryView":143
5184 : * raise ValueError, "Empty shape tuple for cython.array"
5185 : *
5186 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5187 : * raise ValueError, "itemsize <= 0 for cython.array"
5188 : *
5189 : */
5190 0 : __pyx_t_2 = (__pyx_v_itemsize <= 0);
5191 0 : if (unlikely(__pyx_t_2)) {
5192 :
5193 : /* "View.MemoryView":144
5194 : *
5195 : * if itemsize <= 0:
5196 : * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
5197 : *
5198 : * if not isinstance(format, bytes):
5199 : */
5200 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
5201 0 : __PYX_ERR(1, 144, __pyx_L1_error)
5202 :
5203 : /* "View.MemoryView":143
5204 : * raise ValueError, "Empty shape tuple for cython.array"
5205 : *
5206 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5207 : * raise ValueError, "itemsize <= 0 for cython.array"
5208 : *
5209 : */
5210 : }
5211 :
5212 : /* "View.MemoryView":146
5213 : * raise ValueError, "itemsize <= 0 for cython.array"
5214 : *
5215 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5216 : * format = format.encode('ASCII')
5217 : * self._format = format # keep a reference to the byte string
5218 : */
5219 0 : __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5220 0 : __pyx_t_3 = (!__pyx_t_2);
5221 0 : if (__pyx_t_3) {
5222 :
5223 : /* "View.MemoryView":147
5224 : *
5225 : * if not isinstance(format, bytes):
5226 : * format = format.encode('ASCII') # <<<<<<<<<<<<<<
5227 : * self._format = format # keep a reference to the byte string
5228 : * self.format = self._format
5229 : */
5230 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
5231 0 : __Pyx_GOTREF(__pyx_t_5);
5232 0 : __pyx_t_6 = NULL;
5233 0 : __pyx_t_7 = 0;
5234 : #if CYTHON_UNPACK_METHODS
5235 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
5236 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5237 0 : if (likely(__pyx_t_6)) {
5238 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5239 0 : __Pyx_INCREF(__pyx_t_6);
5240 0 : __Pyx_INCREF(function);
5241 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
5242 : __pyx_t_7 = 1;
5243 : }
5244 : }
5245 : #endif
5246 : {
5247 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
5248 0 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
5249 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5250 0 : if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
5251 0 : __Pyx_GOTREF(__pyx_t_4);
5252 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5253 : }
5254 0 : __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
5255 : __pyx_t_4 = 0;
5256 :
5257 : /* "View.MemoryView":146
5258 : * raise ValueError, "itemsize <= 0 for cython.array"
5259 : *
5260 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5261 : * format = format.encode('ASCII')
5262 : * self._format = format # keep a reference to the byte string
5263 : */
5264 : }
5265 :
5266 : /* "View.MemoryView":148
5267 : * if not isinstance(format, bytes):
5268 : * format = format.encode('ASCII')
5269 : * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
5270 : * self.format = self._format
5271 : *
5272 : */
5273 0 : if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
5274 0 : __pyx_t_4 = __pyx_v_format;
5275 0 : __Pyx_INCREF(__pyx_t_4);
5276 0 : __Pyx_GIVEREF(__pyx_t_4);
5277 0 : __Pyx_GOTREF(__pyx_v_self->_format);
5278 0 : __Pyx_DECREF(__pyx_v_self->_format);
5279 0 : __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
5280 0 : __pyx_t_4 = 0;
5281 :
5282 : /* "View.MemoryView":149
5283 : * format = format.encode('ASCII')
5284 : * self._format = format # keep a reference to the byte string
5285 : * self.format = self._format # <<<<<<<<<<<<<<
5286 : *
5287 : *
5288 : */
5289 0 : if (unlikely(__pyx_v_self->_format == Py_None)) {
5290 0 : PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5291 0 : __PYX_ERR(1, 149, __pyx_L1_error)
5292 : }
5293 0 : __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
5294 0 : __pyx_v_self->format = __pyx_t_8;
5295 :
5296 : /* "View.MemoryView":152
5297 : *
5298 : *
5299 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
5300 : * self._strides = self._shape + self.ndim
5301 : *
5302 : */
5303 0 : __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
5304 :
5305 : /* "View.MemoryView":153
5306 : *
5307 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
5308 : * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5309 : *
5310 : * if not self._shape:
5311 : */
5312 0 : __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5313 :
5314 : /* "View.MemoryView":155
5315 : * self._strides = self._shape + self.ndim
5316 : *
5317 : * if not self._shape: # <<<<<<<<<<<<<<
5318 : * raise MemoryError, "unable to allocate shape and strides."
5319 : *
5320 : */
5321 0 : __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
5322 0 : if (unlikely(__pyx_t_3)) {
5323 :
5324 : /* "View.MemoryView":156
5325 : *
5326 : * if not self._shape:
5327 : * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
5328 : *
5329 : *
5330 : */
5331 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
5332 0 : __PYX_ERR(1, 156, __pyx_L1_error)
5333 :
5334 : /* "View.MemoryView":155
5335 : * self._strides = self._shape + self.ndim
5336 : *
5337 : * if not self._shape: # <<<<<<<<<<<<<<
5338 : * raise MemoryError, "unable to allocate shape and strides."
5339 : *
5340 : */
5341 : }
5342 :
5343 : /* "View.MemoryView":159
5344 : *
5345 : *
5346 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5347 : * if dim <= 0:
5348 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5349 : */
5350 0 : __pyx_t_9 = 0;
5351 0 : __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
5352 : __pyx_t_1 = 0;
5353 0 : for (;;) {
5354 0 : {
5355 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
5356 : #if !CYTHON_ASSUME_SAFE_MACROS
5357 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5358 : #endif
5359 0 : if (__pyx_t_1 >= __pyx_temp) break;
5360 : }
5361 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5362 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5363 : #else
5364 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
5365 : __Pyx_GOTREF(__pyx_t_5);
5366 : #endif
5367 0 : __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
5368 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5369 0 : __pyx_v_dim = __pyx_t_10;
5370 0 : __pyx_v_idx = __pyx_t_9;
5371 0 : __pyx_t_9 = (__pyx_t_9 + 1);
5372 :
5373 : /* "View.MemoryView":160
5374 : *
5375 : * for idx, dim in enumerate(shape):
5376 : * if dim <= 0: # <<<<<<<<<<<<<<
5377 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5378 : * self._shape[idx] = dim
5379 : */
5380 0 : __pyx_t_3 = (__pyx_v_dim <= 0);
5381 0 : if (unlikely(__pyx_t_3)) {
5382 :
5383 : /* "View.MemoryView":161
5384 : * for idx, dim in enumerate(shape):
5385 : * if dim <= 0:
5386 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5387 : * self._shape[idx] = dim
5388 : *
5389 : */
5390 0 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
5391 0 : __Pyx_GOTREF(__pyx_t_5);
5392 0 : __pyx_t_10 = 0;
5393 0 : __pyx_t_11 = 127;
5394 0 : __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
5395 0 : __pyx_t_10 += 22;
5396 0 : __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
5397 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
5398 0 : __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5399 0 : __Pyx_GOTREF(__pyx_t_6);
5400 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5401 0 : __Pyx_GIVEREF(__pyx_t_6);
5402 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
5403 0 : __pyx_t_6 = 0;
5404 0 : __Pyx_INCREF(__pyx_kp_u_);
5405 0 : __pyx_t_10 += 2;
5406 0 : __Pyx_GIVEREF(__pyx_kp_u_);
5407 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
5408 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5409 0 : __Pyx_GOTREF(__pyx_t_6);
5410 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5411 0 : __Pyx_GIVEREF(__pyx_t_6);
5412 0 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
5413 0 : __pyx_t_6 = 0;
5414 0 : __Pyx_INCREF(__pyx_kp_u__2);
5415 0 : __pyx_t_10 += 1;
5416 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
5417 0 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
5418 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5419 0 : __Pyx_GOTREF(__pyx_t_6);
5420 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5421 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5422 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5423 0 : __PYX_ERR(1, 161, __pyx_L1_error)
5424 :
5425 : /* "View.MemoryView":160
5426 : *
5427 : * for idx, dim in enumerate(shape):
5428 : * if dim <= 0: # <<<<<<<<<<<<<<
5429 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5430 : * self._shape[idx] = dim
5431 : */
5432 : }
5433 :
5434 : /* "View.MemoryView":162
5435 : * if dim <= 0:
5436 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5437 : * self._shape[idx] = dim # <<<<<<<<<<<<<<
5438 : *
5439 : * cdef char order
5440 : */
5441 0 : (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5442 :
5443 : /* "View.MemoryView":159
5444 : *
5445 : *
5446 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5447 : * if dim <= 0:
5448 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5449 : */
5450 : }
5451 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5452 :
5453 : /* "View.MemoryView":165
5454 : *
5455 : * cdef char order
5456 : * if mode == 'c': # <<<<<<<<<<<<<<
5457 : * order = b'C'
5458 : * self.mode = u'c'
5459 : */
5460 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
5461 0 : if (__pyx_t_3) {
5462 :
5463 : /* "View.MemoryView":166
5464 : * cdef char order
5465 : * if mode == 'c':
5466 : * order = b'C' # <<<<<<<<<<<<<<
5467 : * self.mode = u'c'
5468 : * elif mode == 'fortran':
5469 : */
5470 0 : __pyx_v_order = 'C';
5471 :
5472 : /* "View.MemoryView":167
5473 : * if mode == 'c':
5474 : * order = b'C'
5475 : * self.mode = u'c' # <<<<<<<<<<<<<<
5476 : * elif mode == 'fortran':
5477 : * order = b'F'
5478 : */
5479 0 : __Pyx_INCREF(__pyx_n_u_c);
5480 0 : __Pyx_GIVEREF(__pyx_n_u_c);
5481 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5482 0 : __Pyx_DECREF(__pyx_v_self->mode);
5483 0 : __pyx_v_self->mode = __pyx_n_u_c;
5484 :
5485 : /* "View.MemoryView":165
5486 : *
5487 : * cdef char order
5488 : * if mode == 'c': # <<<<<<<<<<<<<<
5489 : * order = b'C'
5490 : * self.mode = u'c'
5491 : */
5492 0 : goto __pyx_L11;
5493 : }
5494 :
5495 : /* "View.MemoryView":168
5496 : * order = b'C'
5497 : * self.mode = u'c'
5498 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5499 : * order = b'F'
5500 : * self.mode = u'fortran'
5501 : */
5502 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
5503 0 : if (likely(__pyx_t_3)) {
5504 :
5505 : /* "View.MemoryView":169
5506 : * self.mode = u'c'
5507 : * elif mode == 'fortran':
5508 : * order = b'F' # <<<<<<<<<<<<<<
5509 : * self.mode = u'fortran'
5510 : * else:
5511 : */
5512 0 : __pyx_v_order = 'F';
5513 :
5514 : /* "View.MemoryView":170
5515 : * elif mode == 'fortran':
5516 : * order = b'F'
5517 : * self.mode = u'fortran' # <<<<<<<<<<<<<<
5518 : * else:
5519 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5520 : */
5521 0 : __Pyx_INCREF(__pyx_n_u_fortran);
5522 0 : __Pyx_GIVEREF(__pyx_n_u_fortran);
5523 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5524 0 : __Pyx_DECREF(__pyx_v_self->mode);
5525 0 : __pyx_v_self->mode = __pyx_n_u_fortran;
5526 :
5527 : /* "View.MemoryView":168
5528 : * order = b'C'
5529 : * self.mode = u'c'
5530 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5531 : * order = b'F'
5532 : * self.mode = u'fortran'
5533 : */
5534 0 : goto __pyx_L11;
5535 : }
5536 :
5537 : /* "View.MemoryView":172
5538 : * self.mode = u'fortran'
5539 : * else:
5540 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5541 : *
5542 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5543 : */
5544 : /*else*/ {
5545 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
5546 0 : __Pyx_GOTREF(__pyx_t_4);
5547 0 : __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
5548 0 : __Pyx_GOTREF(__pyx_t_6);
5549 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5550 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5551 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5552 0 : __PYX_ERR(1, 172, __pyx_L1_error)
5553 : }
5554 0 : __pyx_L11:;
5555 :
5556 : /* "View.MemoryView":174
5557 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5558 : *
5559 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5560 : *
5561 : * self.free_data = allocate_buffer
5562 : */
5563 0 : __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5564 :
5565 : /* "View.MemoryView":176
5566 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5567 : *
5568 : * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5569 : * self.dtype_is_object = format == b'O'
5570 : *
5571 : */
5572 0 : __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5573 :
5574 : /* "View.MemoryView":177
5575 : *
5576 : * self.free_data = allocate_buffer
5577 : * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5578 : *
5579 : * if allocate_buffer:
5580 : */
5581 0 : __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5582 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
5583 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5584 0 : __pyx_v_self->dtype_is_object = __pyx_t_3;
5585 :
5586 : /* "View.MemoryView":179
5587 : * self.dtype_is_object = format == b'O'
5588 : *
5589 : * if allocate_buffer: # <<<<<<<<<<<<<<
5590 : * _allocate_buffer(self)
5591 : *
5592 : */
5593 0 : if (__pyx_v_allocate_buffer) {
5594 :
5595 : /* "View.MemoryView":180
5596 : *
5597 : * if allocate_buffer:
5598 : * _allocate_buffer(self) # <<<<<<<<<<<<<<
5599 : *
5600 : * @cname('getbuffer')
5601 : */
5602 0 : __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
5603 :
5604 : /* "View.MemoryView":179
5605 : * self.dtype_is_object = format == b'O'
5606 : *
5607 : * if allocate_buffer: # <<<<<<<<<<<<<<
5608 : * _allocate_buffer(self)
5609 : *
5610 : */
5611 : }
5612 :
5613 : /* "View.MemoryView":131
5614 : * cdef bint dtype_is_object
5615 : *
5616 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5617 : * mode="c", bint allocate_buffer=True):
5618 : *
5619 : */
5620 :
5621 : /* function exit code */
5622 0 : __pyx_r = 0;
5623 0 : goto __pyx_L0;
5624 0 : __pyx_L1_error:;
5625 0 : __Pyx_XDECREF(__pyx_t_4);
5626 0 : __Pyx_XDECREF(__pyx_t_5);
5627 0 : __Pyx_XDECREF(__pyx_t_6);
5628 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5629 0 : __pyx_r = -1;
5630 0 : __pyx_L0:;
5631 0 : __Pyx_XDECREF(__pyx_v_format);
5632 0 : __Pyx_RefNannyFinishContext();
5633 0 : return __pyx_r;
5634 : }
5635 :
5636 : /* "View.MemoryView":182
5637 : * _allocate_buffer(self)
5638 : *
5639 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5640 : * def __getbuffer__(self, Py_buffer *info, int flags):
5641 : * cdef int bufmode = -1
5642 : */
5643 :
5644 : /* Python wrapper */
5645 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5646 0 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5647 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5648 0 : int __pyx_r;
5649 : __Pyx_RefNannyDeclarations
5650 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5651 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5652 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5653 :
5654 : /* function exit code */
5655 0 : __Pyx_RefNannyFinishContext();
5656 0 : return __pyx_r;
5657 : }
5658 :
5659 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5660 0 : int __pyx_v_bufmode;
5661 0 : int __pyx_r;
5662 : __Pyx_RefNannyDeclarations
5663 0 : int __pyx_t_1;
5664 0 : char *__pyx_t_2;
5665 0 : Py_ssize_t __pyx_t_3;
5666 0 : int __pyx_t_4;
5667 0 : Py_ssize_t *__pyx_t_5;
5668 0 : int __pyx_lineno = 0;
5669 0 : const char *__pyx_filename = NULL;
5670 0 : int __pyx_clineno = 0;
5671 0 : if (unlikely(__pyx_v_info == NULL)) {
5672 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5673 0 : return -1;
5674 : }
5675 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
5676 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5677 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
5678 :
5679 : /* "View.MemoryView":184
5680 : * @cname('getbuffer')
5681 : * def __getbuffer__(self, Py_buffer *info, int flags):
5682 : * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5683 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5684 : * if self.mode == u"c":
5685 : */
5686 0 : __pyx_v_bufmode = -1;
5687 :
5688 : /* "View.MemoryView":185
5689 : * def __getbuffer__(self, Py_buffer *info, int flags):
5690 : * cdef int bufmode = -1
5691 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5692 : * if self.mode == u"c":
5693 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5694 : */
5695 0 : __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5696 0 : if (__pyx_t_1) {
5697 :
5698 : /* "View.MemoryView":186
5699 : * cdef int bufmode = -1
5700 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5701 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5702 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5703 : * elif self.mode == u"fortran":
5704 : */
5705 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
5706 0 : if (__pyx_t_1) {
5707 :
5708 : /* "View.MemoryView":187
5709 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5710 : * if self.mode == u"c":
5711 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5712 : * elif self.mode == u"fortran":
5713 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5714 : */
5715 0 : __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5716 :
5717 : /* "View.MemoryView":186
5718 : * cdef int bufmode = -1
5719 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5720 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5721 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5722 : * elif self.mode == u"fortran":
5723 : */
5724 0 : goto __pyx_L4;
5725 : }
5726 :
5727 : /* "View.MemoryView":188
5728 : * if self.mode == u"c":
5729 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5730 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5731 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5732 : * if not (flags & bufmode):
5733 : */
5734 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
5735 0 : if (__pyx_t_1) {
5736 :
5737 : /* "View.MemoryView":189
5738 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5739 : * elif self.mode == u"fortran":
5740 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5741 : * if not (flags & bufmode):
5742 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5743 : */
5744 0 : __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5745 :
5746 : /* "View.MemoryView":188
5747 : * if self.mode == u"c":
5748 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5749 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5750 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5751 : * if not (flags & bufmode):
5752 : */
5753 : }
5754 0 : __pyx_L4:;
5755 :
5756 : /* "View.MemoryView":190
5757 : * elif self.mode == u"fortran":
5758 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5759 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5760 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5761 : * info.buf = self.data
5762 : */
5763 0 : __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5764 0 : if (unlikely(__pyx_t_1)) {
5765 :
5766 : /* "View.MemoryView":191
5767 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5768 : * if not (flags & bufmode):
5769 : * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
5770 : * info.buf = self.data
5771 : * info.len = self.len
5772 : */
5773 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
5774 0 : __PYX_ERR(1, 191, __pyx_L1_error)
5775 :
5776 : /* "View.MemoryView":190
5777 : * elif self.mode == u"fortran":
5778 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5779 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5780 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5781 : * info.buf = self.data
5782 : */
5783 : }
5784 :
5785 : /* "View.MemoryView":185
5786 : * def __getbuffer__(self, Py_buffer *info, int flags):
5787 : * cdef int bufmode = -1
5788 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5789 : * if self.mode == u"c":
5790 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5791 : */
5792 : }
5793 :
5794 : /* "View.MemoryView":192
5795 : * if not (flags & bufmode):
5796 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5797 : * info.buf = self.data # <<<<<<<<<<<<<<
5798 : * info.len = self.len
5799 : *
5800 : */
5801 0 : __pyx_t_2 = __pyx_v_self->data;
5802 0 : __pyx_v_info->buf = __pyx_t_2;
5803 :
5804 : /* "View.MemoryView":193
5805 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5806 : * info.buf = self.data
5807 : * info.len = self.len # <<<<<<<<<<<<<<
5808 : *
5809 : * if flags & PyBUF_STRIDES:
5810 : */
5811 0 : __pyx_t_3 = __pyx_v_self->len;
5812 0 : __pyx_v_info->len = __pyx_t_3;
5813 :
5814 : /* "View.MemoryView":195
5815 : * info.len = self.len
5816 : *
5817 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5818 : * info.ndim = self.ndim
5819 : * info.shape = self._shape
5820 : */
5821 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5822 0 : if (__pyx_t_1) {
5823 :
5824 : /* "View.MemoryView":196
5825 : *
5826 : * if flags & PyBUF_STRIDES:
5827 : * info.ndim = self.ndim # <<<<<<<<<<<<<<
5828 : * info.shape = self._shape
5829 : * info.strides = self._strides
5830 : */
5831 0 : __pyx_t_4 = __pyx_v_self->ndim;
5832 0 : __pyx_v_info->ndim = __pyx_t_4;
5833 :
5834 : /* "View.MemoryView":197
5835 : * if flags & PyBUF_STRIDES:
5836 : * info.ndim = self.ndim
5837 : * info.shape = self._shape # <<<<<<<<<<<<<<
5838 : * info.strides = self._strides
5839 : * else:
5840 : */
5841 0 : __pyx_t_5 = __pyx_v_self->_shape;
5842 0 : __pyx_v_info->shape = __pyx_t_5;
5843 :
5844 : /* "View.MemoryView":198
5845 : * info.ndim = self.ndim
5846 : * info.shape = self._shape
5847 : * info.strides = self._strides # <<<<<<<<<<<<<<
5848 : * else:
5849 : * info.ndim = 1
5850 : */
5851 0 : __pyx_t_5 = __pyx_v_self->_strides;
5852 0 : __pyx_v_info->strides = __pyx_t_5;
5853 :
5854 : /* "View.MemoryView":195
5855 : * info.len = self.len
5856 : *
5857 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5858 : * info.ndim = self.ndim
5859 : * info.shape = self._shape
5860 : */
5861 0 : goto __pyx_L6;
5862 : }
5863 :
5864 : /* "View.MemoryView":200
5865 : * info.strides = self._strides
5866 : * else:
5867 : * info.ndim = 1 # <<<<<<<<<<<<<<
5868 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5869 : * info.strides = NULL
5870 : */
5871 : /*else*/ {
5872 0 : __pyx_v_info->ndim = 1;
5873 :
5874 : /* "View.MemoryView":201
5875 : * else:
5876 : * info.ndim = 1
5877 : * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5878 : * info.strides = NULL
5879 : *
5880 : */
5881 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5882 0 : if (__pyx_t_1) {
5883 : __pyx_t_5 = (&__pyx_v_self->len);
5884 : } else {
5885 : __pyx_t_5 = NULL;
5886 : }
5887 0 : __pyx_v_info->shape = __pyx_t_5;
5888 :
5889 : /* "View.MemoryView":202
5890 : * info.ndim = 1
5891 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5892 : * info.strides = NULL # <<<<<<<<<<<<<<
5893 : *
5894 : * info.suboffsets = NULL
5895 : */
5896 0 : __pyx_v_info->strides = NULL;
5897 : }
5898 0 : __pyx_L6:;
5899 :
5900 : /* "View.MemoryView":204
5901 : * info.strides = NULL
5902 : *
5903 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
5904 : * info.itemsize = self.itemsize
5905 : * info.readonly = 0
5906 : */
5907 0 : __pyx_v_info->suboffsets = NULL;
5908 :
5909 : /* "View.MemoryView":205
5910 : *
5911 : * info.suboffsets = NULL
5912 : * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5913 : * info.readonly = 0
5914 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5915 : */
5916 0 : __pyx_t_3 = __pyx_v_self->itemsize;
5917 0 : __pyx_v_info->itemsize = __pyx_t_3;
5918 :
5919 : /* "View.MemoryView":206
5920 : * info.suboffsets = NULL
5921 : * info.itemsize = self.itemsize
5922 : * info.readonly = 0 # <<<<<<<<<<<<<<
5923 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5924 : * info.obj = self
5925 : */
5926 0 : __pyx_v_info->readonly = 0;
5927 :
5928 : /* "View.MemoryView":207
5929 : * info.itemsize = self.itemsize
5930 : * info.readonly = 0
5931 : * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5932 : * info.obj = self
5933 : *
5934 : */
5935 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5936 0 : if (__pyx_t_1) {
5937 0 : __pyx_t_2 = __pyx_v_self->format;
5938 : } else {
5939 : __pyx_t_2 = NULL;
5940 : }
5941 0 : __pyx_v_info->format = __pyx_t_2;
5942 :
5943 : /* "View.MemoryView":208
5944 : * info.readonly = 0
5945 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5946 : * info.obj = self # <<<<<<<<<<<<<<
5947 : *
5948 : * def __dealloc__(array self):
5949 : */
5950 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
5951 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5952 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5953 0 : __Pyx_DECREF(__pyx_v_info->obj);
5954 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5955 :
5956 : /* "View.MemoryView":182
5957 : * _allocate_buffer(self)
5958 : *
5959 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5960 : * def __getbuffer__(self, Py_buffer *info, int flags):
5961 : * cdef int bufmode = -1
5962 : */
5963 :
5964 : /* function exit code */
5965 0 : __pyx_r = 0;
5966 0 : goto __pyx_L0;
5967 0 : __pyx_L1_error:;
5968 0 : __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5969 0 : __pyx_r = -1;
5970 0 : if (__pyx_v_info->obj != NULL) {
5971 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5972 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5973 : }
5974 0 : goto __pyx_L2;
5975 0 : __pyx_L0:;
5976 0 : if (__pyx_v_info->obj == Py_None) {
5977 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5978 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5979 : }
5980 0 : __pyx_L2:;
5981 : __Pyx_RefNannyFinishContext();
5982 : return __pyx_r;
5983 : }
5984 :
5985 : /* "View.MemoryView":210
5986 : * info.obj = self
5987 : *
5988 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
5989 : * if self.callback_free_data != NULL:
5990 : * self.callback_free_data(self.data)
5991 : */
5992 :
5993 : /* Python wrapper */
5994 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5995 0 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5996 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5997 : __Pyx_RefNannyDeclarations
5998 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5999 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6000 0 : __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
6001 :
6002 : /* function exit code */
6003 0 : __Pyx_RefNannyFinishContext();
6004 : }
6005 :
6006 0 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
6007 0 : int __pyx_t_1;
6008 0 : int __pyx_t_2;
6009 :
6010 : /* "View.MemoryView":211
6011 : *
6012 : * def __dealloc__(array self):
6013 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6014 : * self.callback_free_data(self.data)
6015 : * elif self.free_data and self.data is not NULL:
6016 : */
6017 0 : __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
6018 0 : if (__pyx_t_1) {
6019 :
6020 : /* "View.MemoryView":212
6021 : * def __dealloc__(array self):
6022 : * if self.callback_free_data != NULL:
6023 : * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
6024 : * elif self.free_data and self.data is not NULL:
6025 : * if self.dtype_is_object:
6026 : */
6027 0 : __pyx_v_self->callback_free_data(__pyx_v_self->data);
6028 :
6029 : /* "View.MemoryView":211
6030 : *
6031 : * def __dealloc__(array self):
6032 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6033 : * self.callback_free_data(self.data)
6034 : * elif self.free_data and self.data is not NULL:
6035 : */
6036 0 : goto __pyx_L3;
6037 : }
6038 :
6039 : /* "View.MemoryView":213
6040 : * if self.callback_free_data != NULL:
6041 : * self.callback_free_data(self.data)
6042 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6043 : * if self.dtype_is_object:
6044 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6045 : */
6046 0 : if (__pyx_v_self->free_data) {
6047 0 : } else {
6048 0 : __pyx_t_1 = __pyx_v_self->free_data;
6049 0 : goto __pyx_L4_bool_binop_done;
6050 : }
6051 0 : __pyx_t_2 = (__pyx_v_self->data != NULL);
6052 0 : __pyx_t_1 = __pyx_t_2;
6053 0 : __pyx_L4_bool_binop_done:;
6054 0 : if (__pyx_t_1) {
6055 :
6056 : /* "View.MemoryView":214
6057 : * self.callback_free_data(self.data)
6058 : * elif self.free_data and self.data is not NULL:
6059 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6060 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6061 : * free(self.data)
6062 : */
6063 0 : if (__pyx_v_self->dtype_is_object) {
6064 :
6065 : /* "View.MemoryView":215
6066 : * elif self.free_data and self.data is not NULL:
6067 : * if self.dtype_is_object:
6068 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
6069 : * free(self.data)
6070 : * PyObject_Free(self._shape)
6071 : */
6072 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6073 :
6074 : /* "View.MemoryView":214
6075 : * self.callback_free_data(self.data)
6076 : * elif self.free_data and self.data is not NULL:
6077 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6078 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6079 : * free(self.data)
6080 : */
6081 : }
6082 :
6083 : /* "View.MemoryView":216
6084 : * if self.dtype_is_object:
6085 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6086 : * free(self.data) # <<<<<<<<<<<<<<
6087 : * PyObject_Free(self._shape)
6088 : *
6089 : */
6090 0 : free(__pyx_v_self->data);
6091 :
6092 : /* "View.MemoryView":213
6093 : * if self.callback_free_data != NULL:
6094 : * self.callback_free_data(self.data)
6095 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6096 : * if self.dtype_is_object:
6097 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6098 : */
6099 : }
6100 0 : __pyx_L3:;
6101 :
6102 : /* "View.MemoryView":217
6103 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6104 : * free(self.data)
6105 : * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
6106 : *
6107 : * @property
6108 : */
6109 0 : PyObject_Free(__pyx_v_self->_shape);
6110 :
6111 : /* "View.MemoryView":210
6112 : * info.obj = self
6113 : *
6114 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
6115 : * if self.callback_free_data != NULL:
6116 : * self.callback_free_data(self.data)
6117 : */
6118 :
6119 : /* function exit code */
6120 0 : }
6121 :
6122 : /* "View.MemoryView":219
6123 : * PyObject_Free(self._shape)
6124 : *
6125 : * @property # <<<<<<<<<<<<<<
6126 : * def memview(self):
6127 : * return self.get_memview()
6128 : */
6129 :
6130 : /* Python wrapper */
6131 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
6132 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
6133 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6134 0 : PyObject *__pyx_r = 0;
6135 : __Pyx_RefNannyDeclarations
6136 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6137 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6138 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
6139 :
6140 : /* function exit code */
6141 0 : __Pyx_RefNannyFinishContext();
6142 0 : return __pyx_r;
6143 : }
6144 :
6145 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
6146 0 : PyObject *__pyx_r = NULL;
6147 : __Pyx_RefNannyDeclarations
6148 0 : PyObject *__pyx_t_1 = NULL;
6149 0 : int __pyx_lineno = 0;
6150 0 : const char *__pyx_filename = NULL;
6151 0 : int __pyx_clineno = 0;
6152 0 : __Pyx_RefNannySetupContext("__get__", 1);
6153 :
6154 : /* "View.MemoryView":221
6155 : * @property
6156 : * def memview(self):
6157 : * return self.get_memview() # <<<<<<<<<<<<<<
6158 : *
6159 : * @cname('get_memview')
6160 : */
6161 0 : __Pyx_XDECREF(__pyx_r);
6162 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
6163 0 : __Pyx_GOTREF(__pyx_t_1);
6164 0 : __pyx_r = __pyx_t_1;
6165 0 : __pyx_t_1 = 0;
6166 0 : goto __pyx_L0;
6167 :
6168 : /* "View.MemoryView":219
6169 : * PyObject_Free(self._shape)
6170 : *
6171 : * @property # <<<<<<<<<<<<<<
6172 : * def memview(self):
6173 : * return self.get_memview()
6174 : */
6175 :
6176 : /* function exit code */
6177 0 : __pyx_L1_error:;
6178 0 : __Pyx_XDECREF(__pyx_t_1);
6179 0 : __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6180 0 : __pyx_r = NULL;
6181 0 : __pyx_L0:;
6182 0 : __Pyx_XGIVEREF(__pyx_r);
6183 0 : __Pyx_RefNannyFinishContext();
6184 0 : return __pyx_r;
6185 : }
6186 :
6187 : /* "View.MemoryView":224
6188 : *
6189 : * @cname('get_memview')
6190 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6191 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6192 : * return memoryview(self, flags, self.dtype_is_object)
6193 : */
6194 :
6195 0 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
6196 0 : int __pyx_v_flags;
6197 0 : PyObject *__pyx_r = NULL;
6198 : __Pyx_RefNannyDeclarations
6199 0 : PyObject *__pyx_t_1 = NULL;
6200 0 : PyObject *__pyx_t_2 = NULL;
6201 0 : PyObject *__pyx_t_3 = NULL;
6202 0 : int __pyx_lineno = 0;
6203 0 : const char *__pyx_filename = NULL;
6204 0 : int __pyx_clineno = 0;
6205 0 : __Pyx_RefNannySetupContext("get_memview", 1);
6206 :
6207 : /* "View.MemoryView":225
6208 : * @cname('get_memview')
6209 : * cdef get_memview(self):
6210 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
6211 : * return memoryview(self, flags, self.dtype_is_object)
6212 : *
6213 : */
6214 0 : __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6215 :
6216 : /* "View.MemoryView":226
6217 : * cdef get_memview(self):
6218 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6219 : * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
6220 : *
6221 : * def __len__(self):
6222 : */
6223 0 : __Pyx_XDECREF(__pyx_r);
6224 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
6225 0 : __Pyx_GOTREF(__pyx_t_1);
6226 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6227 0 : __Pyx_GOTREF(__pyx_t_2);
6228 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
6229 0 : __Pyx_GOTREF(__pyx_t_3);
6230 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
6231 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6232 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 226, __pyx_L1_error);
6233 0 : __Pyx_GIVEREF(__pyx_t_1);
6234 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error);
6235 0 : __Pyx_GIVEREF(__pyx_t_2);
6236 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error);
6237 0 : __pyx_t_1 = 0;
6238 0 : __pyx_t_2 = 0;
6239 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6240 0 : __Pyx_GOTREF(__pyx_t_2);
6241 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6242 0 : __pyx_r = __pyx_t_2;
6243 0 : __pyx_t_2 = 0;
6244 0 : goto __pyx_L0;
6245 :
6246 : /* "View.MemoryView":224
6247 : *
6248 : * @cname('get_memview')
6249 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6250 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6251 : * return memoryview(self, flags, self.dtype_is_object)
6252 : */
6253 :
6254 : /* function exit code */
6255 0 : __pyx_L1_error:;
6256 0 : __Pyx_XDECREF(__pyx_t_1);
6257 0 : __Pyx_XDECREF(__pyx_t_2);
6258 0 : __Pyx_XDECREF(__pyx_t_3);
6259 0 : __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6260 0 : __pyx_r = 0;
6261 0 : __pyx_L0:;
6262 0 : __Pyx_XGIVEREF(__pyx_r);
6263 0 : __Pyx_RefNannyFinishContext();
6264 0 : return __pyx_r;
6265 : }
6266 :
6267 : /* "View.MemoryView":228
6268 : * return memoryview(self, flags, self.dtype_is_object)
6269 : *
6270 : * def __len__(self): # <<<<<<<<<<<<<<
6271 : * return self._shape[0]
6272 : *
6273 : */
6274 :
6275 : /* Python wrapper */
6276 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6277 0 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6278 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6279 0 : Py_ssize_t __pyx_r;
6280 : __Pyx_RefNannyDeclarations
6281 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6282 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6283 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6284 :
6285 : /* function exit code */
6286 0 : __Pyx_RefNannyFinishContext();
6287 0 : return __pyx_r;
6288 : }
6289 :
6290 0 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6291 0 : Py_ssize_t __pyx_r;
6292 :
6293 : /* "View.MemoryView":229
6294 : *
6295 : * def __len__(self):
6296 : * return self._shape[0] # <<<<<<<<<<<<<<
6297 : *
6298 : * def __getattr__(self, attr):
6299 : */
6300 0 : __pyx_r = (__pyx_v_self->_shape[0]);
6301 0 : goto __pyx_L0;
6302 :
6303 : /* "View.MemoryView":228
6304 : * return memoryview(self, flags, self.dtype_is_object)
6305 : *
6306 : * def __len__(self): # <<<<<<<<<<<<<<
6307 : * return self._shape[0]
6308 : *
6309 : */
6310 :
6311 : /* function exit code */
6312 0 : __pyx_L0:;
6313 0 : return __pyx_r;
6314 : }
6315 :
6316 : /* "View.MemoryView":231
6317 : * return self._shape[0]
6318 : *
6319 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6320 : * return getattr(self.memview, attr)
6321 : *
6322 : */
6323 :
6324 : /* Python wrapper */
6325 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6326 0 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6327 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6328 0 : PyObject *__pyx_r = 0;
6329 : __Pyx_RefNannyDeclarations
6330 0 : __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6331 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6332 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6333 :
6334 : /* function exit code */
6335 0 : __Pyx_RefNannyFinishContext();
6336 0 : return __pyx_r;
6337 : }
6338 :
6339 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6340 0 : PyObject *__pyx_r = NULL;
6341 : __Pyx_RefNannyDeclarations
6342 0 : PyObject *__pyx_t_1 = NULL;
6343 0 : PyObject *__pyx_t_2 = NULL;
6344 0 : int __pyx_lineno = 0;
6345 0 : const char *__pyx_filename = NULL;
6346 0 : int __pyx_clineno = 0;
6347 0 : __Pyx_RefNannySetupContext("__getattr__", 1);
6348 :
6349 : /* "View.MemoryView":232
6350 : *
6351 : * def __getattr__(self, attr):
6352 : * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6353 : *
6354 : * def __getitem__(self, item):
6355 : */
6356 0 : __Pyx_XDECREF(__pyx_r);
6357 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
6358 0 : __Pyx_GOTREF(__pyx_t_1);
6359 0 : __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
6360 0 : __Pyx_GOTREF(__pyx_t_2);
6361 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6362 0 : __pyx_r = __pyx_t_2;
6363 0 : __pyx_t_2 = 0;
6364 0 : goto __pyx_L0;
6365 :
6366 : /* "View.MemoryView":231
6367 : * return self._shape[0]
6368 : *
6369 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6370 : * return getattr(self.memview, attr)
6371 : *
6372 : */
6373 :
6374 : /* function exit code */
6375 0 : __pyx_L1_error:;
6376 0 : __Pyx_XDECREF(__pyx_t_1);
6377 0 : __Pyx_XDECREF(__pyx_t_2);
6378 0 : __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6379 0 : __pyx_r = NULL;
6380 0 : __pyx_L0:;
6381 0 : __Pyx_XGIVEREF(__pyx_r);
6382 0 : __Pyx_RefNannyFinishContext();
6383 0 : return __pyx_r;
6384 : }
6385 :
6386 : /* "View.MemoryView":234
6387 : * return getattr(self.memview, attr)
6388 : *
6389 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6390 : * return self.memview[item]
6391 : *
6392 : */
6393 :
6394 : /* Python wrapper */
6395 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6396 0 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6397 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6398 0 : PyObject *__pyx_r = 0;
6399 : __Pyx_RefNannyDeclarations
6400 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6401 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6402 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6403 :
6404 : /* function exit code */
6405 0 : __Pyx_RefNannyFinishContext();
6406 0 : return __pyx_r;
6407 : }
6408 :
6409 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6410 0 : PyObject *__pyx_r = NULL;
6411 : __Pyx_RefNannyDeclarations
6412 0 : PyObject *__pyx_t_1 = NULL;
6413 0 : PyObject *__pyx_t_2 = NULL;
6414 0 : int __pyx_lineno = 0;
6415 0 : const char *__pyx_filename = NULL;
6416 0 : int __pyx_clineno = 0;
6417 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
6418 :
6419 : /* "View.MemoryView":235
6420 : *
6421 : * def __getitem__(self, item):
6422 : * return self.memview[item] # <<<<<<<<<<<<<<
6423 : *
6424 : * def __setitem__(self, item, value):
6425 : */
6426 0 : __Pyx_XDECREF(__pyx_r);
6427 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
6428 0 : __Pyx_GOTREF(__pyx_t_1);
6429 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
6430 0 : __Pyx_GOTREF(__pyx_t_2);
6431 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6432 0 : __pyx_r = __pyx_t_2;
6433 0 : __pyx_t_2 = 0;
6434 0 : goto __pyx_L0;
6435 :
6436 : /* "View.MemoryView":234
6437 : * return getattr(self.memview, attr)
6438 : *
6439 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6440 : * return self.memview[item]
6441 : *
6442 : */
6443 :
6444 : /* function exit code */
6445 0 : __pyx_L1_error:;
6446 0 : __Pyx_XDECREF(__pyx_t_1);
6447 0 : __Pyx_XDECREF(__pyx_t_2);
6448 0 : __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6449 0 : __pyx_r = NULL;
6450 0 : __pyx_L0:;
6451 0 : __Pyx_XGIVEREF(__pyx_r);
6452 0 : __Pyx_RefNannyFinishContext();
6453 0 : return __pyx_r;
6454 : }
6455 :
6456 : /* "View.MemoryView":237
6457 : * return self.memview[item]
6458 : *
6459 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6460 : * self.memview[item] = value
6461 : *
6462 : */
6463 :
6464 : /* Python wrapper */
6465 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6466 0 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6467 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6468 0 : int __pyx_r;
6469 : __Pyx_RefNannyDeclarations
6470 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6471 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6472 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6473 :
6474 : /* function exit code */
6475 0 : __Pyx_RefNannyFinishContext();
6476 0 : return __pyx_r;
6477 : }
6478 :
6479 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6480 0 : int __pyx_r;
6481 : __Pyx_RefNannyDeclarations
6482 0 : PyObject *__pyx_t_1 = NULL;
6483 0 : int __pyx_lineno = 0;
6484 0 : const char *__pyx_filename = NULL;
6485 0 : int __pyx_clineno = 0;
6486 0 : __Pyx_RefNannySetupContext("__setitem__", 1);
6487 :
6488 : /* "View.MemoryView":238
6489 : *
6490 : * def __setitem__(self, item, value):
6491 : * self.memview[item] = value # <<<<<<<<<<<<<<
6492 : *
6493 : *
6494 : */
6495 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
6496 0 : __Pyx_GOTREF(__pyx_t_1);
6497 0 : if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
6498 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6499 :
6500 : /* "View.MemoryView":237
6501 : * return self.memview[item]
6502 : *
6503 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6504 : * self.memview[item] = value
6505 : *
6506 : */
6507 :
6508 : /* function exit code */
6509 0 : __pyx_r = 0;
6510 0 : goto __pyx_L0;
6511 0 : __pyx_L1_error:;
6512 0 : __Pyx_XDECREF(__pyx_t_1);
6513 0 : __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6514 0 : __pyx_r = -1;
6515 0 : __pyx_L0:;
6516 0 : __Pyx_RefNannyFinishContext();
6517 0 : return __pyx_r;
6518 : }
6519 :
6520 : /* "(tree fragment)":1
6521 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6522 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6523 : * def __setstate_cython__(self, __pyx_state):
6524 : */
6525 :
6526 : /* Python wrapper */
6527 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6528 : #if CYTHON_METH_FASTCALL
6529 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6530 : #else
6531 : PyObject *__pyx_args, PyObject *__pyx_kwds
6532 : #endif
6533 : ); /*proto*/
6534 0 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6535 : #if CYTHON_METH_FASTCALL
6536 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6537 : #else
6538 : PyObject *__pyx_args, PyObject *__pyx_kwds
6539 : #endif
6540 : ) {
6541 : #if !CYTHON_METH_FASTCALL
6542 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6543 : #endif
6544 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6545 0 : PyObject *__pyx_r = 0;
6546 : __Pyx_RefNannyDeclarations
6547 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6548 : #if !CYTHON_METH_FASTCALL
6549 : #if CYTHON_ASSUME_SAFE_MACROS
6550 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6551 : #else
6552 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6553 : #endif
6554 : #endif
6555 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6556 0 : if (unlikely(__pyx_nargs > 0)) {
6557 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
6558 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
6559 0 : __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6560 :
6561 : /* function exit code */
6562 0 : __Pyx_RefNannyFinishContext();
6563 0 : return __pyx_r;
6564 : }
6565 :
6566 0 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6567 0 : PyObject *__pyx_r = NULL;
6568 : __Pyx_RefNannyDeclarations
6569 0 : int __pyx_lineno = 0;
6570 0 : const char *__pyx_filename = NULL;
6571 0 : int __pyx_clineno = 0;
6572 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
6573 :
6574 : /* "(tree fragment)":2
6575 : * def __reduce_cython__(self):
6576 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6577 : * def __setstate_cython__(self, __pyx_state):
6578 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6579 : */
6580 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6581 0 : __PYX_ERR(1, 2, __pyx_L1_error)
6582 :
6583 : /* "(tree fragment)":1
6584 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6585 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6586 : * def __setstate_cython__(self, __pyx_state):
6587 : */
6588 :
6589 : /* function exit code */
6590 0 : __pyx_L1_error:;
6591 0 : __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6592 0 : __pyx_r = NULL;
6593 0 : __Pyx_XGIVEREF(__pyx_r);
6594 0 : __Pyx_RefNannyFinishContext();
6595 0 : return __pyx_r;
6596 : }
6597 :
6598 : /* "(tree fragment)":3
6599 : * def __reduce_cython__(self):
6600 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6601 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6602 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6603 : */
6604 :
6605 : /* Python wrapper */
6606 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6607 : #if CYTHON_METH_FASTCALL
6608 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6609 : #else
6610 : PyObject *__pyx_args, PyObject *__pyx_kwds
6611 : #endif
6612 : ); /*proto*/
6613 0 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6614 : #if CYTHON_METH_FASTCALL
6615 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6616 : #else
6617 : PyObject *__pyx_args, PyObject *__pyx_kwds
6618 : #endif
6619 : ) {
6620 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6621 : #if !CYTHON_METH_FASTCALL
6622 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6623 : #endif
6624 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6625 0 : PyObject* values[1] = {0};
6626 0 : int __pyx_lineno = 0;
6627 0 : const char *__pyx_filename = NULL;
6628 0 : int __pyx_clineno = 0;
6629 0 : PyObject *__pyx_r = 0;
6630 : __Pyx_RefNannyDeclarations
6631 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6632 : #if !CYTHON_METH_FASTCALL
6633 : #if CYTHON_ASSUME_SAFE_MACROS
6634 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6635 : #else
6636 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6637 : #endif
6638 : #endif
6639 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6640 : {
6641 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
6642 0 : if (__pyx_kwds) {
6643 0 : Py_ssize_t kw_args;
6644 0 : switch (__pyx_nargs) {
6645 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6646 0 : CYTHON_FALLTHROUGH;
6647 0 : case 0: break;
6648 0 : default: goto __pyx_L5_argtuple_error;
6649 : }
6650 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
6651 0 : switch (__pyx_nargs) {
6652 : case 0:
6653 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
6654 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
6655 0 : kw_args--;
6656 : }
6657 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
6658 0 : else goto __pyx_L5_argtuple_error;
6659 : }
6660 0 : if (unlikely(kw_args > 0)) {
6661 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
6662 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6663 : }
6664 0 : } else if (unlikely(__pyx_nargs != 1)) {
6665 0 : goto __pyx_L5_argtuple_error;
6666 : } else {
6667 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6668 : }
6669 0 : __pyx_v___pyx_state = values[0];
6670 : }
6671 0 : goto __pyx_L6_skip;
6672 0 : __pyx_L5_argtuple_error:;
6673 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6674 0 : __pyx_L6_skip:;
6675 0 : goto __pyx_L4_argument_unpacking_done;
6676 0 : __pyx_L3_error:;
6677 : {
6678 0 : Py_ssize_t __pyx_temp;
6679 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6680 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6681 : }
6682 : }
6683 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6684 0 : __Pyx_RefNannyFinishContext();
6685 0 : return NULL;
6686 0 : __pyx_L4_argument_unpacking_done:;
6687 0 : __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6688 :
6689 : /* function exit code */
6690 : {
6691 0 : Py_ssize_t __pyx_temp;
6692 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6693 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6694 : }
6695 : }
6696 : __Pyx_RefNannyFinishContext();
6697 : return __pyx_r;
6698 : }
6699 :
6700 0 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6701 0 : PyObject *__pyx_r = NULL;
6702 : __Pyx_RefNannyDeclarations
6703 0 : int __pyx_lineno = 0;
6704 0 : const char *__pyx_filename = NULL;
6705 0 : int __pyx_clineno = 0;
6706 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
6707 :
6708 : /* "(tree fragment)":4
6709 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6710 : * def __setstate_cython__(self, __pyx_state):
6711 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6712 : */
6713 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6714 0 : __PYX_ERR(1, 4, __pyx_L1_error)
6715 :
6716 : /* "(tree fragment)":3
6717 : * def __reduce_cython__(self):
6718 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6719 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6720 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6721 : */
6722 :
6723 : /* function exit code */
6724 0 : __pyx_L1_error:;
6725 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6726 0 : __pyx_r = NULL;
6727 0 : __Pyx_XGIVEREF(__pyx_r);
6728 0 : __Pyx_RefNannyFinishContext();
6729 0 : return __pyx_r;
6730 : }
6731 :
6732 : /* "View.MemoryView":248
6733 : *
6734 : * @cname("__pyx_array_allocate_buffer")
6735 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6736 : *
6737 : *
6738 : */
6739 :
6740 0 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6741 0 : Py_ssize_t __pyx_v_i;
6742 0 : PyObject **__pyx_v_p;
6743 0 : int __pyx_r;
6744 0 : int __pyx_t_1;
6745 0 : Py_ssize_t __pyx_t_2;
6746 0 : Py_ssize_t __pyx_t_3;
6747 0 : Py_ssize_t __pyx_t_4;
6748 0 : int __pyx_lineno = 0;
6749 0 : const char *__pyx_filename = NULL;
6750 0 : int __pyx_clineno = 0;
6751 :
6752 : /* "View.MemoryView":254
6753 : * cdef PyObject **p
6754 : *
6755 : * self.free_data = True # <<<<<<<<<<<<<<
6756 : * self.data = <char *>malloc(self.len)
6757 : * if not self.data:
6758 : */
6759 0 : __pyx_v_self->free_data = 1;
6760 :
6761 : /* "View.MemoryView":255
6762 : *
6763 : * self.free_data = True
6764 : * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
6765 : * if not self.data:
6766 : * raise MemoryError, "unable to allocate array data."
6767 : */
6768 0 : __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6769 :
6770 : /* "View.MemoryView":256
6771 : * self.free_data = True
6772 : * self.data = <char *>malloc(self.len)
6773 : * if not self.data: # <<<<<<<<<<<<<<
6774 : * raise MemoryError, "unable to allocate array data."
6775 : *
6776 : */
6777 0 : __pyx_t_1 = (!(__pyx_v_self->data != 0));
6778 0 : if (unlikely(__pyx_t_1)) {
6779 :
6780 : /* "View.MemoryView":257
6781 : * self.data = <char *>malloc(self.len)
6782 : * if not self.data:
6783 : * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6784 : *
6785 : * if self.dtype_is_object:
6786 : */
6787 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
6788 0 : __PYX_ERR(1, 257, __pyx_L1_error)
6789 :
6790 : /* "View.MemoryView":256
6791 : * self.free_data = True
6792 : * self.data = <char *>malloc(self.len)
6793 : * if not self.data: # <<<<<<<<<<<<<<
6794 : * raise MemoryError, "unable to allocate array data."
6795 : *
6796 : */
6797 : }
6798 :
6799 : /* "View.MemoryView":259
6800 : * raise MemoryError, "unable to allocate array data."
6801 : *
6802 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6803 : * p = <PyObject **> self.data
6804 : * for i in range(self.len // self.itemsize):
6805 : */
6806 0 : if (__pyx_v_self->dtype_is_object) {
6807 :
6808 : /* "View.MemoryView":260
6809 : *
6810 : * if self.dtype_is_object:
6811 : * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6812 : * for i in range(self.len // self.itemsize):
6813 : * p[i] = Py_None
6814 : */
6815 0 : __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6816 :
6817 : /* "View.MemoryView":261
6818 : * if self.dtype_is_object:
6819 : * p = <PyObject **> self.data
6820 : * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6821 : * p[i] = Py_None
6822 : * Py_INCREF(Py_None)
6823 : */
6824 0 : if (unlikely(__pyx_v_self->itemsize == 0)) {
6825 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6826 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6827 : }
6828 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6829 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6830 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6831 : }
6832 0 : __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
6833 0 : __pyx_t_3 = __pyx_t_2;
6834 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6835 0 : __pyx_v_i = __pyx_t_4;
6836 :
6837 : /* "View.MemoryView":262
6838 : * p = <PyObject **> self.data
6839 : * for i in range(self.len // self.itemsize):
6840 : * p[i] = Py_None # <<<<<<<<<<<<<<
6841 : * Py_INCREF(Py_None)
6842 : * return 0
6843 : */
6844 0 : (__pyx_v_p[__pyx_v_i]) = Py_None;
6845 :
6846 : /* "View.MemoryView":263
6847 : * for i in range(self.len // self.itemsize):
6848 : * p[i] = Py_None
6849 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6850 : * return 0
6851 : *
6852 : */
6853 0 : Py_INCREF(Py_None);
6854 : }
6855 :
6856 : /* "View.MemoryView":259
6857 : * raise MemoryError, "unable to allocate array data."
6858 : *
6859 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6860 : * p = <PyObject **> self.data
6861 : * for i in range(self.len // self.itemsize):
6862 : */
6863 : }
6864 :
6865 : /* "View.MemoryView":264
6866 : * p[i] = Py_None
6867 : * Py_INCREF(Py_None)
6868 : * return 0 # <<<<<<<<<<<<<<
6869 : *
6870 : *
6871 : */
6872 0 : __pyx_r = 0;
6873 0 : goto __pyx_L0;
6874 :
6875 : /* "View.MemoryView":248
6876 : *
6877 : * @cname("__pyx_array_allocate_buffer")
6878 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6879 : *
6880 : *
6881 : */
6882 :
6883 : /* function exit code */
6884 0 : __pyx_L1_error:;
6885 0 : __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6886 0 : __pyx_r = -1;
6887 0 : __pyx_L0:;
6888 0 : return __pyx_r;
6889 : }
6890 :
6891 : /* "View.MemoryView":268
6892 : *
6893 : * @cname("__pyx_array_new")
6894 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
6895 : * cdef array result
6896 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6897 : */
6898 :
6899 0 : static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
6900 0 : struct __pyx_array_obj *__pyx_v_result = 0;
6901 0 : PyObject *__pyx_v_mode = 0;
6902 0 : struct __pyx_array_obj *__pyx_r = NULL;
6903 : __Pyx_RefNannyDeclarations
6904 0 : PyObject *__pyx_t_1 = NULL;
6905 0 : int __pyx_t_2;
6906 0 : PyObject *__pyx_t_3 = NULL;
6907 0 : PyObject *__pyx_t_4 = NULL;
6908 0 : int __pyx_lineno = 0;
6909 0 : const char *__pyx_filename = NULL;
6910 0 : int __pyx_clineno = 0;
6911 0 : __Pyx_RefNannySetupContext("array_cwrapper", 1);
6912 :
6913 : /* "View.MemoryView":270
6914 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
6915 : * cdef array result
6916 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6917 : *
6918 : * if buf is NULL:
6919 : */
6920 0 : __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6921 0 : if (__pyx_t_2) {
6922 0 : __Pyx_INCREF(__pyx_n_s_fortran);
6923 : __pyx_t_1 = __pyx_n_s_fortran;
6924 : } else {
6925 0 : __Pyx_INCREF(__pyx_n_s_c);
6926 : __pyx_t_1 = __pyx_n_s_c;
6927 : }
6928 0 : __pyx_v_mode = ((PyObject*)__pyx_t_1);
6929 0 : __pyx_t_1 = 0;
6930 :
6931 : /* "View.MemoryView":272
6932 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6933 : *
6934 : * if buf is NULL: # <<<<<<<<<<<<<<
6935 : * result = array.__new__(array, shape, itemsize, format, mode)
6936 : * else:
6937 : */
6938 0 : __pyx_t_2 = (__pyx_v_buf == NULL);
6939 0 : if (__pyx_t_2) {
6940 :
6941 : /* "View.MemoryView":273
6942 : *
6943 : * if buf is NULL:
6944 : * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6945 : * else:
6946 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6947 : */
6948 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
6949 0 : __Pyx_GOTREF(__pyx_t_1);
6950 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6951 0 : __Pyx_GOTREF(__pyx_t_3);
6952 0 : __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
6953 0 : __Pyx_GOTREF(__pyx_t_4);
6954 0 : __Pyx_INCREF(__pyx_v_shape);
6955 0 : __Pyx_GIVEREF(__pyx_v_shape);
6956 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(1, 273, __pyx_L1_error);
6957 0 : __Pyx_GIVEREF(__pyx_t_1);
6958 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error);
6959 0 : __Pyx_GIVEREF(__pyx_t_3);
6960 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error);
6961 0 : __Pyx_INCREF(__pyx_v_mode);
6962 0 : __Pyx_GIVEREF(__pyx_v_mode);
6963 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(1, 273, __pyx_L1_error);
6964 0 : __pyx_t_1 = 0;
6965 0 : __pyx_t_3 = 0;
6966 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6967 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
6968 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6969 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6970 0 : __pyx_t_3 = 0;
6971 :
6972 : /* "View.MemoryView":272
6973 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6974 : *
6975 : * if buf is NULL: # <<<<<<<<<<<<<<
6976 : * result = array.__new__(array, shape, itemsize, format, mode)
6977 : * else:
6978 : */
6979 0 : goto __pyx_L3;
6980 : }
6981 :
6982 : /* "View.MemoryView":275
6983 : * result = array.__new__(array, shape, itemsize, format, mode)
6984 : * else:
6985 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6986 : * result.data = buf
6987 : *
6988 : */
6989 : /*else*/ {
6990 0 : __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
6991 0 : __Pyx_GOTREF(__pyx_t_3);
6992 0 : __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
6993 0 : __Pyx_GOTREF(__pyx_t_4);
6994 0 : __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
6995 0 : __Pyx_GOTREF(__pyx_t_1);
6996 0 : __Pyx_INCREF(__pyx_v_shape);
6997 0 : __Pyx_GIVEREF(__pyx_v_shape);
6998 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(1, 275, __pyx_L1_error);
6999 0 : __Pyx_GIVEREF(__pyx_t_3);
7000 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error);
7001 0 : __Pyx_GIVEREF(__pyx_t_4);
7002 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error);
7003 0 : __Pyx_INCREF(__pyx_v_mode);
7004 0 : __Pyx_GIVEREF(__pyx_v_mode);
7005 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(1, 275, __pyx_L1_error);
7006 0 : __pyx_t_3 = 0;
7007 0 : __pyx_t_4 = 0;
7008 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
7009 0 : __Pyx_GOTREF(__pyx_t_4);
7010 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
7011 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
7012 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
7013 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7014 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7015 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7016 0 : __pyx_t_3 = 0;
7017 :
7018 : /* "View.MemoryView":276
7019 : * else:
7020 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7021 : * result.data = buf # <<<<<<<<<<<<<<
7022 : *
7023 : * return result
7024 : */
7025 0 : __pyx_v_result->data = __pyx_v_buf;
7026 : }
7027 0 : __pyx_L3:;
7028 :
7029 : /* "View.MemoryView":278
7030 : * result.data = buf
7031 : *
7032 : * return result # <<<<<<<<<<<<<<
7033 : *
7034 : *
7035 : */
7036 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
7037 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
7038 0 : __pyx_r = __pyx_v_result;
7039 0 : goto __pyx_L0;
7040 :
7041 : /* "View.MemoryView":268
7042 : *
7043 : * @cname("__pyx_array_new")
7044 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
7045 : * cdef array result
7046 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7047 : */
7048 :
7049 : /* function exit code */
7050 0 : __pyx_L1_error:;
7051 0 : __Pyx_XDECREF(__pyx_t_1);
7052 0 : __Pyx_XDECREF(__pyx_t_3);
7053 0 : __Pyx_XDECREF(__pyx_t_4);
7054 0 : __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7055 0 : __pyx_r = 0;
7056 0 : __pyx_L0:;
7057 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
7058 0 : __Pyx_XDECREF(__pyx_v_mode);
7059 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
7060 0 : __Pyx_RefNannyFinishContext();
7061 0 : return __pyx_r;
7062 : }
7063 :
7064 : /* "View.MemoryView":304
7065 : * cdef class Enum(object):
7066 : * cdef object name
7067 : * def __init__(self, name): # <<<<<<<<<<<<<<
7068 : * self.name = name
7069 : * def __repr__(self):
7070 : */
7071 :
7072 : /* Python wrapper */
7073 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7074 15 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7075 15 : PyObject *__pyx_v_name = 0;
7076 15 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7077 15 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7078 15 : PyObject* values[1] = {0};
7079 15 : int __pyx_lineno = 0;
7080 15 : const char *__pyx_filename = NULL;
7081 15 : int __pyx_clineno = 0;
7082 15 : int __pyx_r;
7083 : __Pyx_RefNannyDeclarations
7084 15 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7085 : #if CYTHON_ASSUME_SAFE_MACROS
7086 15 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7087 : #else
7088 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7089 : #endif
7090 15 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7091 : {
7092 15 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
7093 15 : if (__pyx_kwds) {
7094 0 : Py_ssize_t kw_args;
7095 0 : switch (__pyx_nargs) {
7096 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7097 0 : CYTHON_FALLTHROUGH;
7098 0 : case 0: break;
7099 0 : default: goto __pyx_L5_argtuple_error;
7100 : }
7101 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7102 0 : switch (__pyx_nargs) {
7103 0 : case 0:
7104 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
7105 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7106 0 : kw_args--;
7107 : }
7108 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
7109 0 : else goto __pyx_L5_argtuple_error;
7110 : }
7111 0 : if (unlikely(kw_args > 0)) {
7112 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7113 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
7114 : }
7115 15 : } else if (unlikely(__pyx_nargs != 1)) {
7116 0 : goto __pyx_L5_argtuple_error;
7117 : } else {
7118 15 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7119 : }
7120 15 : __pyx_v_name = values[0];
7121 : }
7122 15 : goto __pyx_L6_skip;
7123 0 : __pyx_L5_argtuple_error:;
7124 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
7125 15 : __pyx_L6_skip:;
7126 15 : goto __pyx_L4_argument_unpacking_done;
7127 0 : __pyx_L3_error:;
7128 : {
7129 0 : Py_ssize_t __pyx_temp;
7130 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7131 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7132 : }
7133 : }
7134 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7135 0 : __Pyx_RefNannyFinishContext();
7136 0 : return -1;
7137 15 : __pyx_L4_argument_unpacking_done:;
7138 15 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7139 :
7140 : /* function exit code */
7141 : {
7142 15 : Py_ssize_t __pyx_temp;
7143 15 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7144 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7145 : }
7146 : }
7147 : __Pyx_RefNannyFinishContext();
7148 : return __pyx_r;
7149 : }
7150 :
7151 15 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7152 15 : int __pyx_r;
7153 : __Pyx_RefNannyDeclarations
7154 15 : __Pyx_RefNannySetupContext("__init__", 1);
7155 :
7156 : /* "View.MemoryView":305
7157 : * cdef object name
7158 : * def __init__(self, name):
7159 : * self.name = name # <<<<<<<<<<<<<<
7160 : * def __repr__(self):
7161 : * return self.name
7162 : */
7163 15 : __Pyx_INCREF(__pyx_v_name);
7164 15 : __Pyx_GIVEREF(__pyx_v_name);
7165 15 : __Pyx_GOTREF(__pyx_v_self->name);
7166 15 : __Pyx_DECREF(__pyx_v_self->name);
7167 15 : __pyx_v_self->name = __pyx_v_name;
7168 :
7169 : /* "View.MemoryView":304
7170 : * cdef class Enum(object):
7171 : * cdef object name
7172 : * def __init__(self, name): # <<<<<<<<<<<<<<
7173 : * self.name = name
7174 : * def __repr__(self):
7175 : */
7176 :
7177 : /* function exit code */
7178 15 : __pyx_r = 0;
7179 15 : __Pyx_RefNannyFinishContext();
7180 15 : return __pyx_r;
7181 : }
7182 :
7183 : /* "View.MemoryView":306
7184 : * def __init__(self, name):
7185 : * self.name = name
7186 : * def __repr__(self): # <<<<<<<<<<<<<<
7187 : * return self.name
7188 : *
7189 : */
7190 :
7191 : /* Python wrapper */
7192 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
7193 0 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
7194 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7195 0 : PyObject *__pyx_r = 0;
7196 : __Pyx_RefNannyDeclarations
7197 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
7198 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7199 0 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7200 :
7201 : /* function exit code */
7202 0 : __Pyx_RefNannyFinishContext();
7203 0 : return __pyx_r;
7204 : }
7205 :
7206 0 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7207 0 : PyObject *__pyx_r = NULL;
7208 : __Pyx_RefNannyDeclarations
7209 0 : __Pyx_RefNannySetupContext("__repr__", 1);
7210 :
7211 : /* "View.MemoryView":307
7212 : * self.name = name
7213 : * def __repr__(self):
7214 : * return self.name # <<<<<<<<<<<<<<
7215 : *
7216 : * cdef generic = Enum("<strided and direct or indirect>")
7217 : */
7218 0 : __Pyx_XDECREF(__pyx_r);
7219 0 : __Pyx_INCREF(__pyx_v_self->name);
7220 0 : __pyx_r = __pyx_v_self->name;
7221 0 : goto __pyx_L0;
7222 :
7223 : /* "View.MemoryView":306
7224 : * def __init__(self, name):
7225 : * self.name = name
7226 : * def __repr__(self): # <<<<<<<<<<<<<<
7227 : * return self.name
7228 : *
7229 : */
7230 :
7231 : /* function exit code */
7232 0 : __pyx_L0:;
7233 0 : __Pyx_XGIVEREF(__pyx_r);
7234 0 : __Pyx_RefNannyFinishContext();
7235 0 : return __pyx_r;
7236 : }
7237 :
7238 : /* "(tree fragment)":1
7239 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7240 : * cdef tuple state
7241 : * cdef object _dict
7242 : */
7243 :
7244 : /* Python wrapper */
7245 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7246 : #if CYTHON_METH_FASTCALL
7247 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7248 : #else
7249 : PyObject *__pyx_args, PyObject *__pyx_kwds
7250 : #endif
7251 : ); /*proto*/
7252 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7253 : #if CYTHON_METH_FASTCALL
7254 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7255 : #else
7256 : PyObject *__pyx_args, PyObject *__pyx_kwds
7257 : #endif
7258 : ) {
7259 : #if !CYTHON_METH_FASTCALL
7260 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7261 : #endif
7262 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7263 0 : PyObject *__pyx_r = 0;
7264 : __Pyx_RefNannyDeclarations
7265 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7266 : #if !CYTHON_METH_FASTCALL
7267 : #if CYTHON_ASSUME_SAFE_MACROS
7268 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7269 : #else
7270 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7271 : #endif
7272 : #endif
7273 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7274 0 : if (unlikely(__pyx_nargs > 0)) {
7275 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7276 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7277 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7278 :
7279 : /* function exit code */
7280 0 : __Pyx_RefNannyFinishContext();
7281 0 : return __pyx_r;
7282 : }
7283 :
7284 0 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7285 0 : PyObject *__pyx_v_state = 0;
7286 0 : PyObject *__pyx_v__dict = 0;
7287 0 : int __pyx_v_use_setstate;
7288 0 : PyObject *__pyx_r = NULL;
7289 : __Pyx_RefNannyDeclarations
7290 0 : PyObject *__pyx_t_1 = NULL;
7291 0 : int __pyx_t_2;
7292 0 : PyObject *__pyx_t_3 = NULL;
7293 0 : PyObject *__pyx_t_4 = NULL;
7294 0 : int __pyx_lineno = 0;
7295 0 : const char *__pyx_filename = NULL;
7296 0 : int __pyx_clineno = 0;
7297 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7298 :
7299 : /* "(tree fragment)":5
7300 : * cdef object _dict
7301 : * cdef bint use_setstate
7302 : * state = (self.name,) # <<<<<<<<<<<<<<
7303 : * _dict = getattr(self, '__dict__', None)
7304 : * if _dict is not None:
7305 : */
7306 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7307 0 : __Pyx_GOTREF(__pyx_t_1);
7308 0 : __Pyx_INCREF(__pyx_v_self->name);
7309 0 : __Pyx_GIVEREF(__pyx_v_self->name);
7310 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error);
7311 0 : __pyx_v_state = ((PyObject*)__pyx_t_1);
7312 0 : __pyx_t_1 = 0;
7313 :
7314 : /* "(tree fragment)":6
7315 : * cdef bint use_setstate
7316 : * state = (self.name,)
7317 : * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7318 : * if _dict is not None:
7319 : * state += (_dict,)
7320 : */
7321 0 : __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
7322 0 : __Pyx_GOTREF(__pyx_t_1);
7323 0 : __pyx_v__dict = __pyx_t_1;
7324 0 : __pyx_t_1 = 0;
7325 :
7326 : /* "(tree fragment)":7
7327 : * state = (self.name,)
7328 : * _dict = getattr(self, '__dict__', None)
7329 : * if _dict is not None: # <<<<<<<<<<<<<<
7330 : * state += (_dict,)
7331 : * use_setstate = True
7332 : */
7333 0 : __pyx_t_2 = (__pyx_v__dict != Py_None);
7334 0 : if (__pyx_t_2) {
7335 :
7336 : /* "(tree fragment)":8
7337 : * _dict = getattr(self, '__dict__', None)
7338 : * if _dict is not None:
7339 : * state += (_dict,) # <<<<<<<<<<<<<<
7340 : * use_setstate = True
7341 : * else:
7342 : */
7343 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
7344 0 : __Pyx_GOTREF(__pyx_t_1);
7345 0 : __Pyx_INCREF(__pyx_v__dict);
7346 0 : __Pyx_GIVEREF(__pyx_v__dict);
7347 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error);
7348 0 : __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
7349 0 : __Pyx_GOTREF(__pyx_t_3);
7350 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7351 0 : __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
7352 0 : __pyx_t_3 = 0;
7353 :
7354 : /* "(tree fragment)":9
7355 : * if _dict is not None:
7356 : * state += (_dict,)
7357 : * use_setstate = True # <<<<<<<<<<<<<<
7358 : * else:
7359 : * use_setstate = self.name is not None
7360 : */
7361 0 : __pyx_v_use_setstate = 1;
7362 :
7363 : /* "(tree fragment)":7
7364 : * state = (self.name,)
7365 : * _dict = getattr(self, '__dict__', None)
7366 : * if _dict is not None: # <<<<<<<<<<<<<<
7367 : * state += (_dict,)
7368 : * use_setstate = True
7369 : */
7370 0 : goto __pyx_L3;
7371 : }
7372 :
7373 : /* "(tree fragment)":11
7374 : * use_setstate = True
7375 : * else:
7376 : * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7377 : * if use_setstate:
7378 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7379 : */
7380 : /*else*/ {
7381 0 : __pyx_t_2 = (__pyx_v_self->name != Py_None);
7382 0 : __pyx_v_use_setstate = __pyx_t_2;
7383 : }
7384 0 : __pyx_L3:;
7385 :
7386 : /* "(tree fragment)":12
7387 : * else:
7388 : * use_setstate = self.name is not None
7389 : * if use_setstate: # <<<<<<<<<<<<<<
7390 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7391 : * else:
7392 : */
7393 0 : if (__pyx_v_use_setstate) {
7394 :
7395 : /* "(tree fragment)":13
7396 : * use_setstate = self.name is not None
7397 : * if use_setstate:
7398 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7399 : * else:
7400 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7401 : */
7402 0 : __Pyx_XDECREF(__pyx_r);
7403 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
7404 0 : __Pyx_GOTREF(__pyx_t_3);
7405 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7406 0 : __Pyx_GOTREF(__pyx_t_1);
7407 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7408 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7409 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
7410 0 : __Pyx_INCREF(__pyx_int_136983863);
7411 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7412 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 13, __pyx_L1_error);
7413 0 : __Pyx_INCREF(Py_None);
7414 0 : __Pyx_GIVEREF(Py_None);
7415 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
7416 0 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
7417 0 : __Pyx_GOTREF(__pyx_t_4);
7418 0 : __Pyx_GIVEREF(__pyx_t_3);
7419 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error);
7420 0 : __Pyx_GIVEREF(__pyx_t_1);
7421 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
7422 0 : __Pyx_INCREF(__pyx_v_state);
7423 0 : __Pyx_GIVEREF(__pyx_v_state);
7424 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
7425 0 : __pyx_t_3 = 0;
7426 0 : __pyx_t_1 = 0;
7427 0 : __pyx_r = __pyx_t_4;
7428 0 : __pyx_t_4 = 0;
7429 0 : goto __pyx_L0;
7430 :
7431 : /* "(tree fragment)":12
7432 : * else:
7433 : * use_setstate = self.name is not None
7434 : * if use_setstate: # <<<<<<<<<<<<<<
7435 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7436 : * else:
7437 : */
7438 : }
7439 :
7440 : /* "(tree fragment)":15
7441 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7442 : * else:
7443 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7444 : * def __setstate_cython__(self, __pyx_state):
7445 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7446 : */
7447 : /*else*/ {
7448 0 : __Pyx_XDECREF(__pyx_r);
7449 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
7450 0 : __Pyx_GOTREF(__pyx_t_4);
7451 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7452 0 : __Pyx_GOTREF(__pyx_t_1);
7453 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7454 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7455 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
7456 0 : __Pyx_INCREF(__pyx_int_136983863);
7457 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7458 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 15, __pyx_L1_error);
7459 0 : __Pyx_INCREF(__pyx_v_state);
7460 0 : __Pyx_GIVEREF(__pyx_v_state);
7461 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
7462 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
7463 0 : __Pyx_GOTREF(__pyx_t_3);
7464 0 : __Pyx_GIVEREF(__pyx_t_4);
7465 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error);
7466 0 : __Pyx_GIVEREF(__pyx_t_1);
7467 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error);
7468 0 : __pyx_t_4 = 0;
7469 0 : __pyx_t_1 = 0;
7470 0 : __pyx_r = __pyx_t_3;
7471 0 : __pyx_t_3 = 0;
7472 0 : goto __pyx_L0;
7473 : }
7474 :
7475 : /* "(tree fragment)":1
7476 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7477 : * cdef tuple state
7478 : * cdef object _dict
7479 : */
7480 :
7481 : /* function exit code */
7482 0 : __pyx_L1_error:;
7483 0 : __Pyx_XDECREF(__pyx_t_1);
7484 0 : __Pyx_XDECREF(__pyx_t_3);
7485 0 : __Pyx_XDECREF(__pyx_t_4);
7486 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7487 0 : __pyx_r = NULL;
7488 0 : __pyx_L0:;
7489 0 : __Pyx_XDECREF(__pyx_v_state);
7490 0 : __Pyx_XDECREF(__pyx_v__dict);
7491 0 : __Pyx_XGIVEREF(__pyx_r);
7492 0 : __Pyx_RefNannyFinishContext();
7493 0 : return __pyx_r;
7494 : }
7495 :
7496 : /* "(tree fragment)":16
7497 : * else:
7498 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7499 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7500 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7501 : */
7502 :
7503 : /* Python wrapper */
7504 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7505 : #if CYTHON_METH_FASTCALL
7506 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7507 : #else
7508 : PyObject *__pyx_args, PyObject *__pyx_kwds
7509 : #endif
7510 : ); /*proto*/
7511 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7512 : #if CYTHON_METH_FASTCALL
7513 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7514 : #else
7515 : PyObject *__pyx_args, PyObject *__pyx_kwds
7516 : #endif
7517 : ) {
7518 0 : PyObject *__pyx_v___pyx_state = 0;
7519 : #if !CYTHON_METH_FASTCALL
7520 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7521 : #endif
7522 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7523 0 : PyObject* values[1] = {0};
7524 0 : int __pyx_lineno = 0;
7525 0 : const char *__pyx_filename = NULL;
7526 0 : int __pyx_clineno = 0;
7527 0 : PyObject *__pyx_r = 0;
7528 : __Pyx_RefNannyDeclarations
7529 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7530 : #if !CYTHON_METH_FASTCALL
7531 : #if CYTHON_ASSUME_SAFE_MACROS
7532 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7533 : #else
7534 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7535 : #endif
7536 : #endif
7537 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7538 : {
7539 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
7540 0 : if (__pyx_kwds) {
7541 0 : Py_ssize_t kw_args;
7542 0 : switch (__pyx_nargs) {
7543 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7544 0 : CYTHON_FALLTHROUGH;
7545 0 : case 0: break;
7546 0 : default: goto __pyx_L5_argtuple_error;
7547 : }
7548 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
7549 0 : switch (__pyx_nargs) {
7550 : case 0:
7551 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
7552 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7553 0 : kw_args--;
7554 : }
7555 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
7556 0 : else goto __pyx_L5_argtuple_error;
7557 : }
7558 0 : if (unlikely(kw_args > 0)) {
7559 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7560 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
7561 : }
7562 0 : } else if (unlikely(__pyx_nargs != 1)) {
7563 0 : goto __pyx_L5_argtuple_error;
7564 : } else {
7565 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7566 : }
7567 0 : __pyx_v___pyx_state = values[0];
7568 : }
7569 0 : goto __pyx_L6_skip;
7570 0 : __pyx_L5_argtuple_error:;
7571 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
7572 0 : __pyx_L6_skip:;
7573 0 : goto __pyx_L4_argument_unpacking_done;
7574 0 : __pyx_L3_error:;
7575 : {
7576 0 : Py_ssize_t __pyx_temp;
7577 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7578 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7579 : }
7580 : }
7581 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7582 0 : __Pyx_RefNannyFinishContext();
7583 0 : return NULL;
7584 0 : __pyx_L4_argument_unpacking_done:;
7585 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7586 :
7587 : /* function exit code */
7588 : {
7589 0 : Py_ssize_t __pyx_temp;
7590 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7591 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7592 : }
7593 : }
7594 : __Pyx_RefNannyFinishContext();
7595 : return __pyx_r;
7596 : }
7597 :
7598 0 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7599 0 : PyObject *__pyx_r = NULL;
7600 : __Pyx_RefNannyDeclarations
7601 0 : PyObject *__pyx_t_1 = NULL;
7602 0 : int __pyx_lineno = 0;
7603 0 : const char *__pyx_filename = NULL;
7604 0 : int __pyx_clineno = 0;
7605 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
7606 :
7607 : /* "(tree fragment)":17
7608 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7609 : * def __setstate_cython__(self, __pyx_state):
7610 : * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7611 : */
7612 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
7613 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
7614 0 : __Pyx_GOTREF(__pyx_t_1);
7615 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7616 :
7617 : /* "(tree fragment)":16
7618 : * else:
7619 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7620 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7621 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7622 : */
7623 :
7624 : /* function exit code */
7625 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7626 0 : goto __pyx_L0;
7627 0 : __pyx_L1_error:;
7628 0 : __Pyx_XDECREF(__pyx_t_1);
7629 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7630 0 : __pyx_r = NULL;
7631 0 : __pyx_L0:;
7632 0 : __Pyx_XGIVEREF(__pyx_r);
7633 0 : __Pyx_RefNannyFinishContext();
7634 0 : return __pyx_r;
7635 : }
7636 :
7637 : /* "View.MemoryView":349
7638 : * cdef __Pyx_TypeInfo *typeinfo
7639 : *
7640 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7641 : * self.obj = obj
7642 : * self.flags = flags
7643 : */
7644 :
7645 : /* Python wrapper */
7646 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7647 343 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7648 343 : PyObject *__pyx_v_obj = 0;
7649 343 : int __pyx_v_flags;
7650 343 : int __pyx_v_dtype_is_object;
7651 343 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7652 343 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7653 343 : PyObject* values[3] = {0,0,0};
7654 343 : int __pyx_lineno = 0;
7655 343 : const char *__pyx_filename = NULL;
7656 343 : int __pyx_clineno = 0;
7657 343 : int __pyx_r;
7658 : __Pyx_RefNannyDeclarations
7659 343 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7660 : #if CYTHON_ASSUME_SAFE_MACROS
7661 343 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7662 : #else
7663 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7664 : #endif
7665 343 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7666 : {
7667 343 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
7668 343 : if (__pyx_kwds) {
7669 0 : Py_ssize_t kw_args;
7670 0 : switch (__pyx_nargs) {
7671 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7672 0 : CYTHON_FALLTHROUGH;
7673 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7674 0 : CYTHON_FALLTHROUGH;
7675 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7676 0 : CYTHON_FALLTHROUGH;
7677 0 : case 0: break;
7678 0 : default: goto __pyx_L5_argtuple_error;
7679 : }
7680 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7681 0 : switch (__pyx_nargs) {
7682 0 : case 0:
7683 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
7684 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7685 0 : kw_args--;
7686 : }
7687 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7688 0 : else goto __pyx_L5_argtuple_error;
7689 0 : CYTHON_FALLTHROUGH;
7690 : case 1:
7691 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
7692 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
7693 0 : kw_args--;
7694 : }
7695 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7696 : else {
7697 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
7698 : }
7699 0 : CYTHON_FALLTHROUGH;
7700 : case 2:
7701 0 : if (kw_args > 0) {
7702 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
7703 0 : if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
7704 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7705 : }
7706 : }
7707 0 : if (unlikely(kw_args > 0)) {
7708 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7709 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
7710 : }
7711 : } else {
7712 343 : switch (__pyx_nargs) {
7713 343 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7714 343 : CYTHON_FALLTHROUGH;
7715 343 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7716 343 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7717 343 : break;
7718 0 : default: goto __pyx_L5_argtuple_error;
7719 : }
7720 : }
7721 343 : __pyx_v_obj = values[0];
7722 343 : __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7723 343 : if (values[2]) {
7724 343 : __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7725 : } else {
7726 : __pyx_v_dtype_is_object = ((int)0);
7727 : }
7728 : }
7729 343 : goto __pyx_L6_skip;
7730 0 : __pyx_L5_argtuple_error:;
7731 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
7732 343 : __pyx_L6_skip:;
7733 343 : goto __pyx_L4_argument_unpacking_done;
7734 0 : __pyx_L3_error:;
7735 : {
7736 0 : Py_ssize_t __pyx_temp;
7737 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7738 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7739 : }
7740 : }
7741 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7742 0 : __Pyx_RefNannyFinishContext();
7743 0 : return -1;
7744 343 : __pyx_L4_argument_unpacking_done:;
7745 343 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7746 :
7747 : /* function exit code */
7748 : {
7749 343 : Py_ssize_t __pyx_temp;
7750 343 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7751 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7752 : }
7753 : }
7754 : __Pyx_RefNannyFinishContext();
7755 : return __pyx_r;
7756 : }
7757 :
7758 343 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7759 343 : int __pyx_r;
7760 : __Pyx_RefNannyDeclarations
7761 343 : int __pyx_t_1;
7762 343 : int __pyx_t_2;
7763 343 : int __pyx_t_3;
7764 343 : Py_intptr_t __pyx_t_4;
7765 343 : size_t __pyx_t_5;
7766 343 : int __pyx_lineno = 0;
7767 343 : const char *__pyx_filename = NULL;
7768 343 : int __pyx_clineno = 0;
7769 343 : __Pyx_RefNannySetupContext("__cinit__", 1);
7770 :
7771 : /* "View.MemoryView":350
7772 : *
7773 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7774 : * self.obj = obj # <<<<<<<<<<<<<<
7775 : * self.flags = flags
7776 : * if type(self) is memoryview or obj is not None:
7777 : */
7778 343 : __Pyx_INCREF(__pyx_v_obj);
7779 343 : __Pyx_GIVEREF(__pyx_v_obj);
7780 343 : __Pyx_GOTREF(__pyx_v_self->obj);
7781 343 : __Pyx_DECREF(__pyx_v_self->obj);
7782 343 : __pyx_v_self->obj = __pyx_v_obj;
7783 :
7784 : /* "View.MemoryView":351
7785 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7786 : * self.obj = obj
7787 : * self.flags = flags # <<<<<<<<<<<<<<
7788 : * if type(self) is memoryview or obj is not None:
7789 : * __Pyx_GetBuffer(obj, &self.view, flags)
7790 : */
7791 343 : __pyx_v_self->flags = __pyx_v_flags;
7792 :
7793 : /* "View.MemoryView":352
7794 : * self.obj = obj
7795 : * self.flags = flags
7796 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7797 : * __Pyx_GetBuffer(obj, &self.view, flags)
7798 : * if <PyObject *> self.view.obj == NULL:
7799 : */
7800 343 : __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
7801 343 : if (!__pyx_t_2) {
7802 29 : } else {
7803 314 : __pyx_t_1 = __pyx_t_2;
7804 314 : goto __pyx_L4_bool_binop_done;
7805 : }
7806 29 : __pyx_t_2 = (__pyx_v_obj != Py_None);
7807 29 : __pyx_t_1 = __pyx_t_2;
7808 343 : __pyx_L4_bool_binop_done:;
7809 343 : if (__pyx_t_1) {
7810 :
7811 : /* "View.MemoryView":353
7812 : * self.flags = flags
7813 : * if type(self) is memoryview or obj is not None:
7814 : * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7815 : * if <PyObject *> self.view.obj == NULL:
7816 : * (<__pyx_buffer *> &self.view).obj = Py_None
7817 : */
7818 314 : __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
7819 :
7820 : /* "View.MemoryView":354
7821 : * if type(self) is memoryview or obj is not None:
7822 : * __Pyx_GetBuffer(obj, &self.view, flags)
7823 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7824 : * (<__pyx_buffer *> &self.view).obj = Py_None
7825 : * Py_INCREF(Py_None)
7826 : */
7827 314 : __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7828 314 : if (__pyx_t_1) {
7829 :
7830 : /* "View.MemoryView":355
7831 : * __Pyx_GetBuffer(obj, &self.view, flags)
7832 : * if <PyObject *> self.view.obj == NULL:
7833 : * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7834 : * Py_INCREF(Py_None)
7835 : *
7836 : */
7837 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7838 :
7839 : /* "View.MemoryView":356
7840 : * if <PyObject *> self.view.obj == NULL:
7841 : * (<__pyx_buffer *> &self.view).obj = Py_None
7842 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7843 : *
7844 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7845 : */
7846 0 : Py_INCREF(Py_None);
7847 :
7848 : /* "View.MemoryView":354
7849 : * if type(self) is memoryview or obj is not None:
7850 : * __Pyx_GetBuffer(obj, &self.view, flags)
7851 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7852 : * (<__pyx_buffer *> &self.view).obj = Py_None
7853 : * Py_INCREF(Py_None)
7854 : */
7855 : }
7856 :
7857 : /* "View.MemoryView":352
7858 : * self.obj = obj
7859 : * self.flags = flags
7860 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7861 : * __Pyx_GetBuffer(obj, &self.view, flags)
7862 : * if <PyObject *> self.view.obj == NULL:
7863 : */
7864 : }
7865 :
7866 : /* "View.MemoryView":358
7867 : * Py_INCREF(Py_None)
7868 : *
7869 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7870 : * global __pyx_memoryview_thread_locks_used
7871 : * if __pyx_memoryview_thread_locks_used < 8:
7872 : */
7873 343 : __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7874 343 : if (__pyx_t_1) {
7875 :
7876 : /* "View.MemoryView":360
7877 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7878 : * global __pyx_memoryview_thread_locks_used
7879 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7880 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7881 : * __pyx_memoryview_thread_locks_used += 1
7882 : */
7883 : __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
7884 : if (__pyx_t_1) {
7885 :
7886 : /* "View.MemoryView":361
7887 : * global __pyx_memoryview_thread_locks_used
7888 : * if __pyx_memoryview_thread_locks_used < 8:
7889 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7890 : * __pyx_memoryview_thread_locks_used += 1
7891 : * if self.lock is NULL:
7892 : */
7893 : __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7894 :
7895 : /* "View.MemoryView":362
7896 : * if __pyx_memoryview_thread_locks_used < 8:
7897 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7898 : * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7899 : * if self.lock is NULL:
7900 : * self.lock = PyThread_allocate_lock()
7901 : */
7902 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7903 :
7904 : /* "View.MemoryView":360
7905 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7906 : * global __pyx_memoryview_thread_locks_used
7907 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7908 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7909 : * __pyx_memoryview_thread_locks_used += 1
7910 : */
7911 : }
7912 :
7913 : /* "View.MemoryView":363
7914 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7915 : * __pyx_memoryview_thread_locks_used += 1
7916 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7917 : * self.lock = PyThread_allocate_lock()
7918 : * if self.lock is NULL:
7919 : */
7920 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7921 : if (__pyx_t_1) {
7922 :
7923 : /* "View.MemoryView":364
7924 : * __pyx_memoryview_thread_locks_used += 1
7925 : * if self.lock is NULL:
7926 : * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7927 : * if self.lock is NULL:
7928 : * raise MemoryError
7929 : */
7930 : __pyx_v_self->lock = PyThread_allocate_lock();
7931 :
7932 : /* "View.MemoryView":365
7933 : * if self.lock is NULL:
7934 : * self.lock = PyThread_allocate_lock()
7935 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7936 : * raise MemoryError
7937 : *
7938 : */
7939 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7940 : if (unlikely(__pyx_t_1)) {
7941 :
7942 : /* "View.MemoryView":366
7943 : * self.lock = PyThread_allocate_lock()
7944 : * if self.lock is NULL:
7945 : * raise MemoryError # <<<<<<<<<<<<<<
7946 : *
7947 : * if flags & PyBUF_FORMAT:
7948 : */
7949 : PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
7950 :
7951 : /* "View.MemoryView":365
7952 : * if self.lock is NULL:
7953 : * self.lock = PyThread_allocate_lock()
7954 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7955 : * raise MemoryError
7956 : *
7957 : */
7958 : }
7959 :
7960 : /* "View.MemoryView":363
7961 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7962 : * __pyx_memoryview_thread_locks_used += 1
7963 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7964 : * self.lock = PyThread_allocate_lock()
7965 : * if self.lock is NULL:
7966 : */
7967 : }
7968 :
7969 : /* "View.MemoryView":358
7970 : * Py_INCREF(Py_None)
7971 : *
7972 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7973 : * global __pyx_memoryview_thread_locks_used
7974 : * if __pyx_memoryview_thread_locks_used < 8:
7975 : */
7976 : }
7977 :
7978 : /* "View.MemoryView":368
7979 : * raise MemoryError
7980 : *
7981 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7982 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7983 : * else:
7984 : */
7985 343 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7986 343 : if (__pyx_t_1) {
7987 :
7988 : /* "View.MemoryView":369
7989 : *
7990 : * if flags & PyBUF_FORMAT:
7991 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7992 : * else:
7993 : * self.dtype_is_object = dtype_is_object
7994 : */
7995 314 : __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7996 314 : if (__pyx_t_2) {
7997 0 : } else {
7998 314 : __pyx_t_1 = __pyx_t_2;
7999 314 : goto __pyx_L12_bool_binop_done;
8000 : }
8001 0 : __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
8002 0 : __pyx_t_1 = __pyx_t_2;
8003 314 : __pyx_L12_bool_binop_done:;
8004 314 : __pyx_v_self->dtype_is_object = __pyx_t_1;
8005 :
8006 : /* "View.MemoryView":368
8007 : * raise MemoryError
8008 : *
8009 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8010 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8011 : * else:
8012 : */
8013 314 : goto __pyx_L11;
8014 : }
8015 :
8016 : /* "View.MemoryView":371
8017 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8018 : * else:
8019 : * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8020 : *
8021 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8022 : */
8023 : /*else*/ {
8024 29 : __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8025 : }
8026 343 : __pyx_L11:;
8027 :
8028 : /* "View.MemoryView":373
8029 : * self.dtype_is_object = dtype_is_object
8030 : *
8031 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
8032 : * self.typeinfo = NULL
8033 : *
8034 : */
8035 : #ifndef CYTHON_WITHOUT_ASSERTIONS
8036 343 : if (unlikely(__pyx_assertions_enabled())) {
8037 343 : __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
8038 343 : __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
8039 343 : if (unlikely(__pyx_t_5 == 0)) {
8040 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8041 : __PYX_ERR(1, 373, __pyx_L1_error)
8042 : }
8043 343 : __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
8044 343 : if (unlikely(!__pyx_t_1)) {
8045 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
8046 0 : __PYX_ERR(1, 373, __pyx_L1_error)
8047 : }
8048 : }
8049 : #else
8050 : if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
8051 : #endif
8052 :
8053 : /* "View.MemoryView":374
8054 : *
8055 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8056 : * self.typeinfo = NULL # <<<<<<<<<<<<<<
8057 : *
8058 : * def __dealloc__(memoryview self):
8059 : */
8060 343 : __pyx_v_self->typeinfo = NULL;
8061 :
8062 : /* "View.MemoryView":349
8063 : * cdef __Pyx_TypeInfo *typeinfo
8064 : *
8065 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8066 : * self.obj = obj
8067 : * self.flags = flags
8068 : */
8069 :
8070 : /* function exit code */
8071 343 : __pyx_r = 0;
8072 343 : goto __pyx_L0;
8073 0 : __pyx_L1_error:;
8074 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8075 0 : __pyx_r = -1;
8076 343 : __pyx_L0:;
8077 343 : __Pyx_RefNannyFinishContext();
8078 343 : return __pyx_r;
8079 : }
8080 :
8081 : /* "View.MemoryView":376
8082 : * self.typeinfo = NULL
8083 : *
8084 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8085 : * if self.obj is not None:
8086 : * __Pyx_ReleaseBuffer(&self.view)
8087 : */
8088 :
8089 : /* Python wrapper */
8090 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
8091 343 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8092 343 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8093 : __Pyx_RefNannyDeclarations
8094 343 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8095 343 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8096 343 : __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
8097 :
8098 : /* function exit code */
8099 343 : __Pyx_RefNannyFinishContext();
8100 : }
8101 :
8102 343 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8103 343 : int __pyx_v_i;
8104 343 : int __pyx_t_1;
8105 343 : int __pyx_t_2;
8106 343 : int __pyx_t_3;
8107 343 : int __pyx_t_4;
8108 343 : PyThread_type_lock __pyx_t_5;
8109 343 : PyThread_type_lock __pyx_t_6;
8110 :
8111 : /* "View.MemoryView":377
8112 : *
8113 : * def __dealloc__(memoryview self):
8114 : * if self.obj is not None: # <<<<<<<<<<<<<<
8115 : * __Pyx_ReleaseBuffer(&self.view)
8116 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8117 : */
8118 343 : __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8119 343 : if (__pyx_t_1) {
8120 :
8121 : /* "View.MemoryView":378
8122 : * def __dealloc__(memoryview self):
8123 : * if self.obj is not None:
8124 : * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
8125 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8126 : *
8127 : */
8128 314 : __Pyx_ReleaseBuffer((&__pyx_v_self->view));
8129 :
8130 : /* "View.MemoryView":377
8131 : *
8132 : * def __dealloc__(memoryview self):
8133 : * if self.obj is not None: # <<<<<<<<<<<<<<
8134 : * __Pyx_ReleaseBuffer(&self.view)
8135 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8136 : */
8137 314 : goto __pyx_L3;
8138 : }
8139 :
8140 : /* "View.MemoryView":379
8141 : * if self.obj is not None:
8142 : * __Pyx_ReleaseBuffer(&self.view)
8143 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8144 : *
8145 : * (<__pyx_buffer *> &self.view).obj = NULL
8146 : */
8147 29 : __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8148 29 : if (__pyx_t_1) {
8149 :
8150 : /* "View.MemoryView":381
8151 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8152 : *
8153 : * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
8154 : * Py_DECREF(Py_None)
8155 : *
8156 : */
8157 29 : ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8158 :
8159 : /* "View.MemoryView":382
8160 : *
8161 : * (<__pyx_buffer *> &self.view).obj = NULL
8162 : * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
8163 : *
8164 : * cdef int i
8165 : */
8166 29 : Py_DECREF(Py_None);
8167 :
8168 : /* "View.MemoryView":379
8169 : * if self.obj is not None:
8170 : * __Pyx_ReleaseBuffer(&self.view)
8171 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8172 : *
8173 : * (<__pyx_buffer *> &self.view).obj = NULL
8174 : */
8175 : }
8176 0 : __pyx_L3:;
8177 :
8178 : /* "View.MemoryView":386
8179 : * cdef int i
8180 : * global __pyx_memoryview_thread_locks_used
8181 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8182 : * for i in range(__pyx_memoryview_thread_locks_used):
8183 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8184 : */
8185 343 : __pyx_t_1 = (__pyx_v_self->lock != NULL);
8186 343 : if (__pyx_t_1) {
8187 :
8188 : /* "View.MemoryView":387
8189 : * global __pyx_memoryview_thread_locks_used
8190 : * if self.lock != NULL:
8191 : * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
8192 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8193 : * __pyx_memoryview_thread_locks_used -= 1
8194 : */
8195 0 : __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8196 0 : __pyx_t_3 = __pyx_t_2;
8197 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8198 0 : __pyx_v_i = __pyx_t_4;
8199 :
8200 : /* "View.MemoryView":388
8201 : * if self.lock != NULL:
8202 : * for i in range(__pyx_memoryview_thread_locks_used):
8203 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8204 : * __pyx_memoryview_thread_locks_used -= 1
8205 : * if i != __pyx_memoryview_thread_locks_used:
8206 : */
8207 0 : __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8208 0 : if (__pyx_t_1) {
8209 :
8210 : /* "View.MemoryView":389
8211 : * for i in range(__pyx_memoryview_thread_locks_used):
8212 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8213 : * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8214 : * if i != __pyx_memoryview_thread_locks_used:
8215 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8216 : */
8217 0 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8218 :
8219 : /* "View.MemoryView":390
8220 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8221 : * __pyx_memoryview_thread_locks_used -= 1
8222 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8223 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8224 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8225 : */
8226 0 : __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8227 0 : if (__pyx_t_1) {
8228 :
8229 : /* "View.MemoryView":392
8230 : * if i != __pyx_memoryview_thread_locks_used:
8231 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8232 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8233 : * break
8234 : * else:
8235 : */
8236 0 : __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8237 0 : __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8238 :
8239 : /* "View.MemoryView":391
8240 : * __pyx_memoryview_thread_locks_used -= 1
8241 : * if i != __pyx_memoryview_thread_locks_used:
8242 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8243 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8244 : * break
8245 : */
8246 0 : (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8247 0 : (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8248 :
8249 : /* "View.MemoryView":390
8250 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8251 : * __pyx_memoryview_thread_locks_used -= 1
8252 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8253 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8254 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8255 : */
8256 : }
8257 :
8258 : /* "View.MemoryView":393
8259 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8260 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8261 : * break # <<<<<<<<<<<<<<
8262 : * else:
8263 : * PyThread_free_lock(self.lock)
8264 : */
8265 0 : goto __pyx_L6_break;
8266 :
8267 : /* "View.MemoryView":388
8268 : * if self.lock != NULL:
8269 : * for i in range(__pyx_memoryview_thread_locks_used):
8270 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8271 : * __pyx_memoryview_thread_locks_used -= 1
8272 : * if i != __pyx_memoryview_thread_locks_used:
8273 : */
8274 : }
8275 : }
8276 : /*else*/ {
8277 :
8278 : /* "View.MemoryView":395
8279 : * break
8280 : * else:
8281 : * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8282 : *
8283 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8284 : */
8285 0 : PyThread_free_lock(__pyx_v_self->lock);
8286 : }
8287 343 : __pyx_L6_break:;
8288 :
8289 : /* "View.MemoryView":386
8290 : * cdef int i
8291 : * global __pyx_memoryview_thread_locks_used
8292 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8293 : * for i in range(__pyx_memoryview_thread_locks_used):
8294 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8295 : */
8296 : }
8297 :
8298 : /* "View.MemoryView":376
8299 : * self.typeinfo = NULL
8300 : *
8301 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8302 : * if self.obj is not None:
8303 : * __Pyx_ReleaseBuffer(&self.view)
8304 : */
8305 :
8306 : /* function exit code */
8307 343 : }
8308 :
8309 : /* "View.MemoryView":397
8310 : * PyThread_free_lock(self.lock)
8311 : *
8312 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8313 : * cdef Py_ssize_t dim
8314 : * cdef char *itemp = <char *> self.view.buf
8315 : */
8316 :
8317 0 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8318 0 : Py_ssize_t __pyx_v_dim;
8319 0 : char *__pyx_v_itemp;
8320 0 : PyObject *__pyx_v_idx = NULL;
8321 0 : char *__pyx_r;
8322 : __Pyx_RefNannyDeclarations
8323 0 : Py_ssize_t __pyx_t_1;
8324 0 : PyObject *__pyx_t_2 = NULL;
8325 0 : Py_ssize_t __pyx_t_3;
8326 0 : PyObject *(*__pyx_t_4)(PyObject *);
8327 0 : PyObject *__pyx_t_5 = NULL;
8328 0 : Py_ssize_t __pyx_t_6;
8329 0 : char *__pyx_t_7;
8330 0 : int __pyx_lineno = 0;
8331 0 : const char *__pyx_filename = NULL;
8332 0 : int __pyx_clineno = 0;
8333 0 : __Pyx_RefNannySetupContext("get_item_pointer", 1);
8334 :
8335 : /* "View.MemoryView":399
8336 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8337 : * cdef Py_ssize_t dim
8338 : * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8339 : *
8340 : * for dim, idx in enumerate(index):
8341 : */
8342 0 : __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8343 :
8344 : /* "View.MemoryView":401
8345 : * cdef char *itemp = <char *> self.view.buf
8346 : *
8347 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8348 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8349 : *
8350 : */
8351 0 : __pyx_t_1 = 0;
8352 0 : if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
8353 0 : __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8354 0 : __pyx_t_3 = 0;
8355 0 : __pyx_t_4 = NULL;
8356 : } else {
8357 0 : __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
8358 0 : __Pyx_GOTREF(__pyx_t_2);
8359 0 : __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
8360 : }
8361 0 : for (;;) {
8362 0 : if (likely(!__pyx_t_4)) {
8363 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
8364 : {
8365 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
8366 : #if !CYTHON_ASSUME_SAFE_MACROS
8367 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8368 : #endif
8369 0 : if (__pyx_t_3 >= __pyx_temp) break;
8370 : }
8371 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8372 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8373 : #else
8374 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8375 : __Pyx_GOTREF(__pyx_t_5);
8376 : #endif
8377 : } else {
8378 : {
8379 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8380 : #if !CYTHON_ASSUME_SAFE_MACROS
8381 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8382 : #endif
8383 0 : if (__pyx_t_3 >= __pyx_temp) break;
8384 : }
8385 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8386 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8387 : #else
8388 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8389 : __Pyx_GOTREF(__pyx_t_5);
8390 : #endif
8391 : }
8392 : } else {
8393 0 : __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8394 0 : if (unlikely(!__pyx_t_5)) {
8395 0 : PyObject* exc_type = PyErr_Occurred();
8396 0 : if (exc_type) {
8397 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8398 0 : else __PYX_ERR(1, 401, __pyx_L1_error)
8399 : }
8400 : break;
8401 : }
8402 0 : __Pyx_GOTREF(__pyx_t_5);
8403 : }
8404 0 : __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8405 0 : __pyx_t_5 = 0;
8406 0 : __pyx_v_dim = __pyx_t_1;
8407 0 : __pyx_t_1 = (__pyx_t_1 + 1);
8408 :
8409 : /* "View.MemoryView":402
8410 : *
8411 : * for dim, idx in enumerate(index):
8412 : * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8413 : *
8414 : * return itemp
8415 : */
8416 0 : __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
8417 0 : __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
8418 : __pyx_v_itemp = __pyx_t_7;
8419 :
8420 : /* "View.MemoryView":401
8421 : * cdef char *itemp = <char *> self.view.buf
8422 : *
8423 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8424 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8425 : *
8426 : */
8427 : }
8428 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8429 :
8430 : /* "View.MemoryView":404
8431 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8432 : *
8433 : * return itemp # <<<<<<<<<<<<<<
8434 : *
8435 : *
8436 : */
8437 0 : __pyx_r = __pyx_v_itemp;
8438 0 : goto __pyx_L0;
8439 :
8440 : /* "View.MemoryView":397
8441 : * PyThread_free_lock(self.lock)
8442 : *
8443 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8444 : * cdef Py_ssize_t dim
8445 : * cdef char *itemp = <char *> self.view.buf
8446 : */
8447 :
8448 : /* function exit code */
8449 0 : __pyx_L1_error:;
8450 0 : __Pyx_XDECREF(__pyx_t_2);
8451 0 : __Pyx_XDECREF(__pyx_t_5);
8452 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8453 0 : __pyx_r = NULL;
8454 0 : __pyx_L0:;
8455 0 : __Pyx_XDECREF(__pyx_v_idx);
8456 0 : __Pyx_RefNannyFinishContext();
8457 0 : return __pyx_r;
8458 : }
8459 :
8460 : /* "View.MemoryView":407
8461 : *
8462 : *
8463 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8464 : * if index is Ellipsis:
8465 : * return self
8466 : */
8467 :
8468 : /* Python wrapper */
8469 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8470 0 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8471 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8472 0 : PyObject *__pyx_r = 0;
8473 : __Pyx_RefNannyDeclarations
8474 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8475 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8476 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8477 :
8478 : /* function exit code */
8479 0 : __Pyx_RefNannyFinishContext();
8480 0 : return __pyx_r;
8481 : }
8482 :
8483 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8484 0 : PyObject *__pyx_v_have_slices = NULL;
8485 0 : PyObject *__pyx_v_indices = NULL;
8486 0 : char *__pyx_v_itemp;
8487 0 : PyObject *__pyx_r = NULL;
8488 : __Pyx_RefNannyDeclarations
8489 0 : int __pyx_t_1;
8490 0 : PyObject *__pyx_t_2 = NULL;
8491 0 : PyObject *__pyx_t_3 = NULL;
8492 0 : PyObject *__pyx_t_4 = NULL;
8493 0 : char *__pyx_t_5;
8494 0 : int __pyx_lineno = 0;
8495 0 : const char *__pyx_filename = NULL;
8496 0 : int __pyx_clineno = 0;
8497 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
8498 :
8499 : /* "View.MemoryView":408
8500 : *
8501 : * def __getitem__(memoryview self, object index):
8502 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8503 : * return self
8504 : *
8505 : */
8506 0 : __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8507 0 : if (__pyx_t_1) {
8508 :
8509 : /* "View.MemoryView":409
8510 : * def __getitem__(memoryview self, object index):
8511 : * if index is Ellipsis:
8512 : * return self # <<<<<<<<<<<<<<
8513 : *
8514 : * have_slices, indices = _unellipsify(index, self.view.ndim)
8515 : */
8516 0 : __Pyx_XDECREF(__pyx_r);
8517 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
8518 0 : __pyx_r = ((PyObject *)__pyx_v_self);
8519 0 : goto __pyx_L0;
8520 :
8521 : /* "View.MemoryView":408
8522 : *
8523 : * def __getitem__(memoryview self, object index):
8524 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8525 : * return self
8526 : *
8527 : */
8528 : }
8529 :
8530 : /* "View.MemoryView":411
8531 : * return self
8532 : *
8533 : * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8534 : *
8535 : * cdef char *itemp
8536 : */
8537 0 : __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
8538 0 : __Pyx_GOTREF(__pyx_t_2);
8539 0 : if (likely(__pyx_t_2 != Py_None)) {
8540 0 : PyObject* sequence = __pyx_t_2;
8541 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8542 0 : if (unlikely(size != 2)) {
8543 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8544 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8545 0 : __PYX_ERR(1, 411, __pyx_L1_error)
8546 : }
8547 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8548 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8549 0 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8550 0 : __Pyx_INCREF(__pyx_t_3);
8551 0 : __Pyx_INCREF(__pyx_t_4);
8552 : #else
8553 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
8554 : __Pyx_GOTREF(__pyx_t_3);
8555 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
8556 : __Pyx_GOTREF(__pyx_t_4);
8557 : #endif
8558 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8559 : } else {
8560 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
8561 : }
8562 0 : __pyx_v_have_slices = __pyx_t_3;
8563 0 : __pyx_t_3 = 0;
8564 0 : __pyx_v_indices = __pyx_t_4;
8565 0 : __pyx_t_4 = 0;
8566 :
8567 : /* "View.MemoryView":414
8568 : *
8569 : * cdef char *itemp
8570 : * if have_slices: # <<<<<<<<<<<<<<
8571 : * return memview_slice(self, indices)
8572 : * else:
8573 : */
8574 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
8575 0 : if (__pyx_t_1) {
8576 :
8577 : /* "View.MemoryView":415
8578 : * cdef char *itemp
8579 : * if have_slices:
8580 : * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8581 : * else:
8582 : * itemp = self.get_item_pointer(indices)
8583 : */
8584 0 : __Pyx_XDECREF(__pyx_r);
8585 0 : __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
8586 0 : __Pyx_GOTREF(__pyx_t_2);
8587 0 : __pyx_r = __pyx_t_2;
8588 0 : __pyx_t_2 = 0;
8589 0 : goto __pyx_L0;
8590 :
8591 : /* "View.MemoryView":414
8592 : *
8593 : * cdef char *itemp
8594 : * if have_slices: # <<<<<<<<<<<<<<
8595 : * return memview_slice(self, indices)
8596 : * else:
8597 : */
8598 : }
8599 :
8600 : /* "View.MemoryView":417
8601 : * return memview_slice(self, indices)
8602 : * else:
8603 : * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
8604 : * return self.convert_item_to_object(itemp)
8605 : *
8606 : */
8607 : /*else*/ {
8608 0 : __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
8609 0 : __pyx_v_itemp = __pyx_t_5;
8610 :
8611 : /* "View.MemoryView":418
8612 : * else:
8613 : * itemp = self.get_item_pointer(indices)
8614 : * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8615 : *
8616 : * def __setitem__(memoryview self, object index, object value):
8617 : */
8618 0 : __Pyx_XDECREF(__pyx_r);
8619 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
8620 0 : __Pyx_GOTREF(__pyx_t_2);
8621 0 : __pyx_r = __pyx_t_2;
8622 0 : __pyx_t_2 = 0;
8623 0 : goto __pyx_L0;
8624 : }
8625 :
8626 : /* "View.MemoryView":407
8627 : *
8628 : *
8629 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8630 : * if index is Ellipsis:
8631 : * return self
8632 : */
8633 :
8634 : /* function exit code */
8635 0 : __pyx_L1_error:;
8636 0 : __Pyx_XDECREF(__pyx_t_2);
8637 0 : __Pyx_XDECREF(__pyx_t_3);
8638 0 : __Pyx_XDECREF(__pyx_t_4);
8639 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8640 0 : __pyx_r = NULL;
8641 0 : __pyx_L0:;
8642 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8643 0 : __Pyx_XDECREF(__pyx_v_indices);
8644 0 : __Pyx_XGIVEREF(__pyx_r);
8645 0 : __Pyx_RefNannyFinishContext();
8646 0 : return __pyx_r;
8647 : }
8648 :
8649 : /* "View.MemoryView":420
8650 : * return self.convert_item_to_object(itemp)
8651 : *
8652 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8653 : * if self.view.readonly:
8654 : * raise TypeError, "Cannot assign to read-only memoryview"
8655 : */
8656 :
8657 : /* Python wrapper */
8658 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8659 0 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8660 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8661 0 : int __pyx_r;
8662 : __Pyx_RefNannyDeclarations
8663 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8664 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8665 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8666 :
8667 : /* function exit code */
8668 0 : __Pyx_RefNannyFinishContext();
8669 0 : return __pyx_r;
8670 : }
8671 :
8672 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8673 0 : PyObject *__pyx_v_have_slices = NULL;
8674 0 : PyObject *__pyx_v_obj = NULL;
8675 0 : int __pyx_r;
8676 : __Pyx_RefNannyDeclarations
8677 0 : PyObject *__pyx_t_1 = NULL;
8678 0 : PyObject *__pyx_t_2 = NULL;
8679 0 : PyObject *__pyx_t_3 = NULL;
8680 0 : int __pyx_t_4;
8681 0 : int __pyx_lineno = 0;
8682 0 : const char *__pyx_filename = NULL;
8683 0 : int __pyx_clineno = 0;
8684 0 : __Pyx_RefNannySetupContext("__setitem__", 0);
8685 0 : __Pyx_INCREF(__pyx_v_index);
8686 :
8687 : /* "View.MemoryView":421
8688 : *
8689 : * def __setitem__(memoryview self, object index, object value):
8690 : * if self.view.readonly: # <<<<<<<<<<<<<<
8691 : * raise TypeError, "Cannot assign to read-only memoryview"
8692 : *
8693 : */
8694 0 : if (unlikely(__pyx_v_self->view.readonly)) {
8695 :
8696 : /* "View.MemoryView":422
8697 : * def __setitem__(memoryview self, object index, object value):
8698 : * if self.view.readonly:
8699 : * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8700 : *
8701 : * have_slices, index = _unellipsify(index, self.view.ndim)
8702 : */
8703 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
8704 0 : __PYX_ERR(1, 422, __pyx_L1_error)
8705 :
8706 : /* "View.MemoryView":421
8707 : *
8708 : * def __setitem__(memoryview self, object index, object value):
8709 : * if self.view.readonly: # <<<<<<<<<<<<<<
8710 : * raise TypeError, "Cannot assign to read-only memoryview"
8711 : *
8712 : */
8713 : }
8714 :
8715 : /* "View.MemoryView":424
8716 : * raise TypeError, "Cannot assign to read-only memoryview"
8717 : *
8718 : * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8719 : *
8720 : * if have_slices:
8721 : */
8722 0 : __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
8723 0 : __Pyx_GOTREF(__pyx_t_1);
8724 0 : if (likely(__pyx_t_1 != Py_None)) {
8725 0 : PyObject* sequence = __pyx_t_1;
8726 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8727 0 : if (unlikely(size != 2)) {
8728 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8729 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8730 0 : __PYX_ERR(1, 424, __pyx_L1_error)
8731 : }
8732 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8733 0 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
8734 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
8735 0 : __Pyx_INCREF(__pyx_t_2);
8736 0 : __Pyx_INCREF(__pyx_t_3);
8737 : #else
8738 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
8739 : __Pyx_GOTREF(__pyx_t_2);
8740 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
8741 : __Pyx_GOTREF(__pyx_t_3);
8742 : #endif
8743 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8744 : } else {
8745 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
8746 : }
8747 0 : __pyx_v_have_slices = __pyx_t_2;
8748 0 : __pyx_t_2 = 0;
8749 0 : __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
8750 0 : __pyx_t_3 = 0;
8751 :
8752 : /* "View.MemoryView":426
8753 : * have_slices, index = _unellipsify(index, self.view.ndim)
8754 : *
8755 : * if have_slices: # <<<<<<<<<<<<<<
8756 : * obj = self.is_slice(value)
8757 : * if obj is not None:
8758 : */
8759 0 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
8760 0 : if (__pyx_t_4) {
8761 :
8762 : /* "View.MemoryView":427
8763 : *
8764 : * if have_slices:
8765 : * obj = self.is_slice(value) # <<<<<<<<<<<<<<
8766 : * if obj is not None:
8767 : * self.setitem_slice_assignment(self[index], obj)
8768 : */
8769 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
8770 0 : __Pyx_GOTREF(__pyx_t_1);
8771 0 : __pyx_v_obj = __pyx_t_1;
8772 0 : __pyx_t_1 = 0;
8773 :
8774 : /* "View.MemoryView":428
8775 : * if have_slices:
8776 : * obj = self.is_slice(value)
8777 : * if obj is not None: # <<<<<<<<<<<<<<
8778 : * self.setitem_slice_assignment(self[index], obj)
8779 : * else:
8780 : */
8781 0 : __pyx_t_4 = (__pyx_v_obj != Py_None);
8782 0 : if (__pyx_t_4) {
8783 :
8784 : /* "View.MemoryView":429
8785 : * obj = self.is_slice(value)
8786 : * if obj is not None:
8787 : * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
8788 : * else:
8789 : * self.setitem_slice_assign_scalar(self[index], value)
8790 : */
8791 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
8792 0 : __Pyx_GOTREF(__pyx_t_1);
8793 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
8794 0 : __Pyx_GOTREF(__pyx_t_3);
8795 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8796 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8797 :
8798 : /* "View.MemoryView":428
8799 : * if have_slices:
8800 : * obj = self.is_slice(value)
8801 : * if obj is not None: # <<<<<<<<<<<<<<
8802 : * self.setitem_slice_assignment(self[index], obj)
8803 : * else:
8804 : */
8805 0 : goto __pyx_L5;
8806 : }
8807 :
8808 : /* "View.MemoryView":431
8809 : * self.setitem_slice_assignment(self[index], obj)
8810 : * else:
8811 : * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
8812 : * else:
8813 : * self.setitem_indexed(index, value)
8814 : */
8815 : /*else*/ {
8816 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
8817 0 : __Pyx_GOTREF(__pyx_t_3);
8818 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
8819 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
8820 0 : __Pyx_GOTREF(__pyx_t_1);
8821 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8822 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8823 : }
8824 0 : __pyx_L5:;
8825 :
8826 : /* "View.MemoryView":426
8827 : * have_slices, index = _unellipsify(index, self.view.ndim)
8828 : *
8829 : * if have_slices: # <<<<<<<<<<<<<<
8830 : * obj = self.is_slice(value)
8831 : * if obj is not None:
8832 : */
8833 0 : goto __pyx_L4;
8834 : }
8835 :
8836 : /* "View.MemoryView":433
8837 : * self.setitem_slice_assign_scalar(self[index], value)
8838 : * else:
8839 : * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
8840 : *
8841 : * cdef is_slice(self, obj):
8842 : */
8843 : /*else*/ {
8844 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
8845 0 : __Pyx_GOTREF(__pyx_t_1);
8846 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8847 : }
8848 0 : __pyx_L4:;
8849 :
8850 : /* "View.MemoryView":420
8851 : * return self.convert_item_to_object(itemp)
8852 : *
8853 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8854 : * if self.view.readonly:
8855 : * raise TypeError, "Cannot assign to read-only memoryview"
8856 : */
8857 :
8858 : /* function exit code */
8859 0 : __pyx_r = 0;
8860 0 : goto __pyx_L0;
8861 0 : __pyx_L1_error:;
8862 0 : __Pyx_XDECREF(__pyx_t_1);
8863 0 : __Pyx_XDECREF(__pyx_t_2);
8864 0 : __Pyx_XDECREF(__pyx_t_3);
8865 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8866 0 : __pyx_r = -1;
8867 0 : __pyx_L0:;
8868 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8869 0 : __Pyx_XDECREF(__pyx_v_obj);
8870 0 : __Pyx_XDECREF(__pyx_v_index);
8871 0 : __Pyx_RefNannyFinishContext();
8872 0 : return __pyx_r;
8873 : }
8874 :
8875 : /* "View.MemoryView":435
8876 : * self.setitem_indexed(index, value)
8877 : *
8878 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8879 : * if not isinstance(obj, memoryview):
8880 : * try:
8881 : */
8882 :
8883 0 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8884 0 : PyObject *__pyx_r = NULL;
8885 : __Pyx_RefNannyDeclarations
8886 0 : int __pyx_t_1;
8887 0 : int __pyx_t_2;
8888 0 : PyObject *__pyx_t_3 = NULL;
8889 0 : PyObject *__pyx_t_4 = NULL;
8890 0 : PyObject *__pyx_t_5 = NULL;
8891 0 : PyObject *__pyx_t_6 = NULL;
8892 0 : PyObject *__pyx_t_7 = NULL;
8893 0 : PyObject *__pyx_t_8 = NULL;
8894 0 : int __pyx_t_9;
8895 0 : int __pyx_lineno = 0;
8896 0 : const char *__pyx_filename = NULL;
8897 0 : int __pyx_clineno = 0;
8898 0 : __Pyx_RefNannySetupContext("is_slice", 0);
8899 0 : __Pyx_INCREF(__pyx_v_obj);
8900 :
8901 : /* "View.MemoryView":436
8902 : *
8903 : * cdef is_slice(self, obj):
8904 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8905 : * try:
8906 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8907 : */
8908 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
8909 0 : __pyx_t_2 = (!__pyx_t_1);
8910 0 : if (__pyx_t_2) {
8911 :
8912 : /* "View.MemoryView":437
8913 : * cdef is_slice(self, obj):
8914 : * if not isinstance(obj, memoryview):
8915 : * try: # <<<<<<<<<<<<<<
8916 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8917 : * self.dtype_is_object)
8918 : */
8919 : {
8920 0 : __Pyx_PyThreadState_declare
8921 0 : __Pyx_PyThreadState_assign
8922 0 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8923 0 : __Pyx_XGOTREF(__pyx_t_3);
8924 0 : __Pyx_XGOTREF(__pyx_t_4);
8925 0 : __Pyx_XGOTREF(__pyx_t_5);
8926 : /*try:*/ {
8927 :
8928 : /* "View.MemoryView":438
8929 : * if not isinstance(obj, memoryview):
8930 : * try:
8931 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8932 : * self.dtype_is_object)
8933 : * except TypeError:
8934 : */
8935 0 : __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
8936 0 : __Pyx_GOTREF(__pyx_t_6);
8937 :
8938 : /* "View.MemoryView":439
8939 : * try:
8940 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8941 : * self.dtype_is_object) # <<<<<<<<<<<<<<
8942 : * except TypeError:
8943 : * return None
8944 : */
8945 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
8946 0 : __Pyx_GOTREF(__pyx_t_7);
8947 :
8948 : /* "View.MemoryView":438
8949 : * if not isinstance(obj, memoryview):
8950 : * try:
8951 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8952 : * self.dtype_is_object)
8953 : * except TypeError:
8954 : */
8955 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
8956 0 : __Pyx_GOTREF(__pyx_t_8);
8957 0 : __Pyx_INCREF(__pyx_v_obj);
8958 0 : __Pyx_GIVEREF(__pyx_v_obj);
8959 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(1, 438, __pyx_L4_error);
8960 0 : __Pyx_GIVEREF(__pyx_t_6);
8961 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error);
8962 0 : __Pyx_GIVEREF(__pyx_t_7);
8963 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error);
8964 0 : __pyx_t_6 = 0;
8965 0 : __pyx_t_7 = 0;
8966 0 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
8967 0 : __Pyx_GOTREF(__pyx_t_7);
8968 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8969 0 : __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
8970 0 : __pyx_t_7 = 0;
8971 :
8972 : /* "View.MemoryView":437
8973 : * cdef is_slice(self, obj):
8974 : * if not isinstance(obj, memoryview):
8975 : * try: # <<<<<<<<<<<<<<
8976 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8977 : * self.dtype_is_object)
8978 : */
8979 : }
8980 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8981 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8982 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8983 0 : goto __pyx_L9_try_end;
8984 0 : __pyx_L4_error:;
8985 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8986 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8987 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8988 :
8989 : /* "View.MemoryView":440
8990 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8991 : * self.dtype_is_object)
8992 : * except TypeError: # <<<<<<<<<<<<<<
8993 : * return None
8994 : *
8995 : */
8996 0 : __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
8997 0 : if (__pyx_t_9) {
8998 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8999 0 : if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
9000 0 : __Pyx_XGOTREF(__pyx_t_7);
9001 0 : __Pyx_XGOTREF(__pyx_t_8);
9002 0 : __Pyx_XGOTREF(__pyx_t_6);
9003 :
9004 : /* "View.MemoryView":441
9005 : * self.dtype_is_object)
9006 : * except TypeError:
9007 : * return None # <<<<<<<<<<<<<<
9008 : *
9009 : * return obj
9010 : */
9011 0 : __Pyx_XDECREF(__pyx_r);
9012 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9013 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9014 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9015 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9016 0 : goto __pyx_L7_except_return;
9017 : }
9018 0 : goto __pyx_L6_except_error;
9019 :
9020 : /* "View.MemoryView":437
9021 : * cdef is_slice(self, obj):
9022 : * if not isinstance(obj, memoryview):
9023 : * try: # <<<<<<<<<<<<<<
9024 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9025 : * self.dtype_is_object)
9026 : */
9027 0 : __pyx_L6_except_error:;
9028 0 : __Pyx_XGIVEREF(__pyx_t_3);
9029 0 : __Pyx_XGIVEREF(__pyx_t_4);
9030 0 : __Pyx_XGIVEREF(__pyx_t_5);
9031 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9032 0 : goto __pyx_L1_error;
9033 0 : __pyx_L7_except_return:;
9034 0 : __Pyx_XGIVEREF(__pyx_t_3);
9035 0 : __Pyx_XGIVEREF(__pyx_t_4);
9036 0 : __Pyx_XGIVEREF(__pyx_t_5);
9037 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9038 0 : goto __pyx_L0;
9039 0 : __pyx_L9_try_end:;
9040 : }
9041 :
9042 : /* "View.MemoryView":436
9043 : *
9044 : * cdef is_slice(self, obj):
9045 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9046 : * try:
9047 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9048 : */
9049 : }
9050 :
9051 : /* "View.MemoryView":443
9052 : * return None
9053 : *
9054 : * return obj # <<<<<<<<<<<<<<
9055 : *
9056 : * cdef setitem_slice_assignment(self, dst, src):
9057 : */
9058 0 : __Pyx_XDECREF(__pyx_r);
9059 0 : __Pyx_INCREF(__pyx_v_obj);
9060 0 : __pyx_r = __pyx_v_obj;
9061 0 : goto __pyx_L0;
9062 :
9063 : /* "View.MemoryView":435
9064 : * self.setitem_indexed(index, value)
9065 : *
9066 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9067 : * if not isinstance(obj, memoryview):
9068 : * try:
9069 : */
9070 :
9071 : /* function exit code */
9072 0 : __pyx_L1_error:;
9073 0 : __Pyx_XDECREF(__pyx_t_6);
9074 0 : __Pyx_XDECREF(__pyx_t_7);
9075 0 : __Pyx_XDECREF(__pyx_t_8);
9076 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9077 0 : __pyx_r = 0;
9078 0 : __pyx_L0:;
9079 0 : __Pyx_XDECREF(__pyx_v_obj);
9080 0 : __Pyx_XGIVEREF(__pyx_r);
9081 0 : __Pyx_RefNannyFinishContext();
9082 0 : return __pyx_r;
9083 : }
9084 :
9085 : /* "View.MemoryView":445
9086 : * return obj
9087 : *
9088 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9089 : * cdef __Pyx_memviewslice dst_slice
9090 : * cdef __Pyx_memviewslice src_slice
9091 : */
9092 :
9093 0 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9094 0 : __Pyx_memviewslice __pyx_v_dst_slice;
9095 0 : __Pyx_memviewslice __pyx_v_src_slice;
9096 0 : __Pyx_memviewslice __pyx_v_msrc;
9097 0 : __Pyx_memviewslice __pyx_v_mdst;
9098 0 : PyObject *__pyx_r = NULL;
9099 : __Pyx_RefNannyDeclarations
9100 0 : __Pyx_memviewslice *__pyx_t_1;
9101 0 : PyObject *__pyx_t_2 = NULL;
9102 0 : int __pyx_t_3;
9103 0 : int __pyx_t_4;
9104 0 : int __pyx_t_5;
9105 0 : int __pyx_lineno = 0;
9106 0 : const char *__pyx_filename = NULL;
9107 0 : int __pyx_clineno = 0;
9108 0 : __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);
9109 :
9110 : /* "View.MemoryView":448
9111 : * cdef __Pyx_memviewslice dst_slice
9112 : * cdef __Pyx_memviewslice src_slice
9113 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
9114 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9115 : *
9116 : */
9117 0 : if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
9118 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
9119 0 : __pyx_v_msrc = (__pyx_t_1[0]);
9120 :
9121 : /* "View.MemoryView":449
9122 : * cdef __Pyx_memviewslice src_slice
9123 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
9124 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
9125 : *
9126 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9127 : */
9128 0 : if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
9129 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
9130 0 : __pyx_v_mdst = (__pyx_t_1[0]);
9131 :
9132 : /* "View.MemoryView":451
9133 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9134 : *
9135 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
9136 : *
9137 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9138 : */
9139 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9140 0 : __Pyx_GOTREF(__pyx_t_2);
9141 0 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9142 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9143 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9144 0 : __Pyx_GOTREF(__pyx_t_2);
9145 0 : __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9146 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9147 0 : __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
9148 :
9149 : /* "View.MemoryView":445
9150 : * return obj
9151 : *
9152 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9153 : * cdef __Pyx_memviewslice dst_slice
9154 : * cdef __Pyx_memviewslice src_slice
9155 : */
9156 :
9157 : /* function exit code */
9158 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9159 0 : goto __pyx_L0;
9160 0 : __pyx_L1_error:;
9161 0 : __Pyx_XDECREF(__pyx_t_2);
9162 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9163 0 : __pyx_r = 0;
9164 0 : __pyx_L0:;
9165 0 : __Pyx_XGIVEREF(__pyx_r);
9166 0 : __Pyx_RefNannyFinishContext();
9167 0 : return __pyx_r;
9168 : }
9169 :
9170 : /* "View.MemoryView":453
9171 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9172 : *
9173 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9174 : * cdef int array[128]
9175 : * cdef void *tmp = NULL
9176 : */
9177 :
9178 0 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9179 0 : int __pyx_v_array[0x80];
9180 0 : void *__pyx_v_tmp;
9181 0 : void *__pyx_v_item;
9182 0 : __Pyx_memviewslice *__pyx_v_dst_slice;
9183 0 : __Pyx_memviewslice __pyx_v_tmp_slice;
9184 0 : PyObject *__pyx_r = NULL;
9185 : __Pyx_RefNannyDeclarations
9186 0 : __Pyx_memviewslice *__pyx_t_1;
9187 0 : int __pyx_t_2;
9188 0 : PyObject *__pyx_t_3 = NULL;
9189 0 : int __pyx_t_4;
9190 0 : int __pyx_t_5;
9191 0 : char const *__pyx_t_6;
9192 0 : PyObject *__pyx_t_7 = NULL;
9193 0 : PyObject *__pyx_t_8 = NULL;
9194 0 : PyObject *__pyx_t_9 = NULL;
9195 0 : PyObject *__pyx_t_10 = NULL;
9196 0 : PyObject *__pyx_t_11 = NULL;
9197 0 : PyObject *__pyx_t_12 = NULL;
9198 0 : int __pyx_lineno = 0;
9199 0 : const char *__pyx_filename = NULL;
9200 0 : int __pyx_clineno = 0;
9201 0 : __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);
9202 :
9203 : /* "View.MemoryView":455
9204 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9205 : * cdef int array[128]
9206 : * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9207 : * cdef void *item
9208 : *
9209 : */
9210 0 : __pyx_v_tmp = NULL;
9211 :
9212 : /* "View.MemoryView":460
9213 : * cdef __Pyx_memviewslice *dst_slice
9214 : * cdef __Pyx_memviewslice tmp_slice
9215 : * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9216 : *
9217 : * if <size_t>self.view.itemsize > sizeof(array):
9218 : */
9219 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
9220 0 : __pyx_v_dst_slice = __pyx_t_1;
9221 :
9222 : /* "View.MemoryView":462
9223 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9224 : *
9225 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9226 : * tmp = PyMem_Malloc(self.view.itemsize)
9227 : * if tmp == NULL:
9228 : */
9229 0 : __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9230 0 : if (__pyx_t_2) {
9231 :
9232 : /* "View.MemoryView":463
9233 : *
9234 : * if <size_t>self.view.itemsize > sizeof(array):
9235 : * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
9236 : * if tmp == NULL:
9237 : * raise MemoryError
9238 : */
9239 0 : __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9240 :
9241 : /* "View.MemoryView":464
9242 : * if <size_t>self.view.itemsize > sizeof(array):
9243 : * tmp = PyMem_Malloc(self.view.itemsize)
9244 : * if tmp == NULL: # <<<<<<<<<<<<<<
9245 : * raise MemoryError
9246 : * item = tmp
9247 : */
9248 0 : __pyx_t_2 = (__pyx_v_tmp == NULL);
9249 0 : if (unlikely(__pyx_t_2)) {
9250 :
9251 : /* "View.MemoryView":465
9252 : * tmp = PyMem_Malloc(self.view.itemsize)
9253 : * if tmp == NULL:
9254 : * raise MemoryError # <<<<<<<<<<<<<<
9255 : * item = tmp
9256 : * else:
9257 : */
9258 0 : PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
9259 :
9260 : /* "View.MemoryView":464
9261 : * if <size_t>self.view.itemsize > sizeof(array):
9262 : * tmp = PyMem_Malloc(self.view.itemsize)
9263 : * if tmp == NULL: # <<<<<<<<<<<<<<
9264 : * raise MemoryError
9265 : * item = tmp
9266 : */
9267 : }
9268 :
9269 : /* "View.MemoryView":466
9270 : * if tmp == NULL:
9271 : * raise MemoryError
9272 : * item = tmp # <<<<<<<<<<<<<<
9273 : * else:
9274 : * item = <void *> array
9275 : */
9276 0 : __pyx_v_item = __pyx_v_tmp;
9277 :
9278 : /* "View.MemoryView":462
9279 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9280 : *
9281 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9282 : * tmp = PyMem_Malloc(self.view.itemsize)
9283 : * if tmp == NULL:
9284 : */
9285 0 : goto __pyx_L3;
9286 : }
9287 :
9288 : /* "View.MemoryView":468
9289 : * item = tmp
9290 : * else:
9291 : * item = <void *> array # <<<<<<<<<<<<<<
9292 : *
9293 : * try:
9294 : */
9295 : /*else*/ {
9296 : __pyx_v_item = ((void *)__pyx_v_array);
9297 : }
9298 0 : __pyx_L3:;
9299 :
9300 : /* "View.MemoryView":470
9301 : * item = <void *> array
9302 : *
9303 : * try: # <<<<<<<<<<<<<<
9304 : * if self.dtype_is_object:
9305 : * (<PyObject **> item)[0] = <PyObject *> value
9306 : */
9307 : /*try:*/ {
9308 :
9309 : /* "View.MemoryView":471
9310 : *
9311 : * try:
9312 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9313 : * (<PyObject **> item)[0] = <PyObject *> value
9314 : * else:
9315 : */
9316 0 : if (__pyx_v_self->dtype_is_object) {
9317 :
9318 : /* "View.MemoryView":472
9319 : * try:
9320 : * if self.dtype_is_object:
9321 : * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9322 : * else:
9323 : * self.assign_item_from_object(<char *> item, value)
9324 : */
9325 0 : (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9326 :
9327 : /* "View.MemoryView":471
9328 : *
9329 : * try:
9330 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9331 : * (<PyObject **> item)[0] = <PyObject *> value
9332 : * else:
9333 : */
9334 0 : goto __pyx_L8;
9335 : }
9336 :
9337 : /* "View.MemoryView":474
9338 : * (<PyObject **> item)[0] = <PyObject *> value
9339 : * else:
9340 : * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9341 : *
9342 : *
9343 : */
9344 : /*else*/ {
9345 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
9346 0 : __Pyx_GOTREF(__pyx_t_3);
9347 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9348 : }
9349 0 : __pyx_L8:;
9350 :
9351 : /* "View.MemoryView":478
9352 : *
9353 : *
9354 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9355 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9356 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9357 : */
9358 0 : __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9359 0 : if (__pyx_t_2) {
9360 :
9361 : /* "View.MemoryView":479
9362 : *
9363 : * if self.view.suboffsets != NULL:
9364 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9365 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9366 : * item, self.dtype_is_object)
9367 : */
9368 0 : __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
9369 :
9370 : /* "View.MemoryView":478
9371 : *
9372 : *
9373 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9374 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9375 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9376 : */
9377 : }
9378 :
9379 : /* "View.MemoryView":480
9380 : * if self.view.suboffsets != NULL:
9381 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9382 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
9383 : * item, self.dtype_is_object)
9384 : * finally:
9385 : */
9386 0 : __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
9387 : }
9388 :
9389 : /* "View.MemoryView":483
9390 : * item, self.dtype_is_object)
9391 : * finally:
9392 : * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9393 : *
9394 : * cdef setitem_indexed(self, index, value):
9395 : */
9396 : /*finally:*/ {
9397 : /*normal exit:*/{
9398 0 : PyMem_Free(__pyx_v_tmp);
9399 0 : goto __pyx_L7;
9400 : }
9401 0 : __pyx_L6_error:;
9402 : /*exception exit:*/{
9403 0 : __Pyx_PyThreadState_declare
9404 0 : __Pyx_PyThreadState_assign
9405 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9406 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9407 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9408 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9409 0 : __Pyx_XGOTREF(__pyx_t_7);
9410 0 : __Pyx_XGOTREF(__pyx_t_8);
9411 0 : __Pyx_XGOTREF(__pyx_t_9);
9412 0 : __Pyx_XGOTREF(__pyx_t_10);
9413 0 : __Pyx_XGOTREF(__pyx_t_11);
9414 0 : __Pyx_XGOTREF(__pyx_t_12);
9415 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9416 : {
9417 0 : PyMem_Free(__pyx_v_tmp);
9418 : }
9419 0 : if (PY_MAJOR_VERSION >= 3) {
9420 0 : __Pyx_XGIVEREF(__pyx_t_10);
9421 0 : __Pyx_XGIVEREF(__pyx_t_11);
9422 0 : __Pyx_XGIVEREF(__pyx_t_12);
9423 0 : __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9424 : }
9425 0 : __Pyx_XGIVEREF(__pyx_t_7);
9426 0 : __Pyx_XGIVEREF(__pyx_t_8);
9427 0 : __Pyx_XGIVEREF(__pyx_t_9);
9428 0 : __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9429 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9430 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9431 0 : goto __pyx_L1_error;
9432 : }
9433 0 : __pyx_L7:;
9434 : }
9435 :
9436 : /* "View.MemoryView":453
9437 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9438 : *
9439 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9440 : * cdef int array[128]
9441 : * cdef void *tmp = NULL
9442 : */
9443 :
9444 : /* function exit code */
9445 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9446 0 : goto __pyx_L0;
9447 0 : __pyx_L1_error:;
9448 0 : __Pyx_XDECREF(__pyx_t_3);
9449 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9450 0 : __pyx_r = 0;
9451 0 : __pyx_L0:;
9452 0 : __Pyx_XGIVEREF(__pyx_r);
9453 0 : __Pyx_RefNannyFinishContext();
9454 0 : return __pyx_r;
9455 : }
9456 :
9457 : /* "View.MemoryView":485
9458 : * PyMem_Free(tmp)
9459 : *
9460 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9461 : * cdef char *itemp = self.get_item_pointer(index)
9462 : * self.assign_item_from_object(itemp, value)
9463 : */
9464 :
9465 0 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9466 0 : char *__pyx_v_itemp;
9467 0 : PyObject *__pyx_r = NULL;
9468 : __Pyx_RefNannyDeclarations
9469 0 : char *__pyx_t_1;
9470 0 : PyObject *__pyx_t_2 = NULL;
9471 0 : int __pyx_lineno = 0;
9472 0 : const char *__pyx_filename = NULL;
9473 0 : int __pyx_clineno = 0;
9474 0 : __Pyx_RefNannySetupContext("setitem_indexed", 1);
9475 :
9476 : /* "View.MemoryView":486
9477 : *
9478 : * cdef setitem_indexed(self, index, value):
9479 : * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
9480 : * self.assign_item_from_object(itemp, value)
9481 : *
9482 : */
9483 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
9484 0 : __pyx_v_itemp = __pyx_t_1;
9485 :
9486 : /* "View.MemoryView":487
9487 : * cdef setitem_indexed(self, index, value):
9488 : * cdef char *itemp = self.get_item_pointer(index)
9489 : * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9490 : *
9491 : * cdef convert_item_to_object(self, char *itemp):
9492 : */
9493 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
9494 0 : __Pyx_GOTREF(__pyx_t_2);
9495 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9496 :
9497 : /* "View.MemoryView":485
9498 : * PyMem_Free(tmp)
9499 : *
9500 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9501 : * cdef char *itemp = self.get_item_pointer(index)
9502 : * self.assign_item_from_object(itemp, value)
9503 : */
9504 :
9505 : /* function exit code */
9506 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9507 0 : goto __pyx_L0;
9508 0 : __pyx_L1_error:;
9509 0 : __Pyx_XDECREF(__pyx_t_2);
9510 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9511 0 : __pyx_r = 0;
9512 0 : __pyx_L0:;
9513 0 : __Pyx_XGIVEREF(__pyx_r);
9514 0 : __Pyx_RefNannyFinishContext();
9515 0 : return __pyx_r;
9516 : }
9517 :
9518 : /* "View.MemoryView":489
9519 : * self.assign_item_from_object(itemp, value)
9520 : *
9521 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9522 : * """Only used if instantiated manually by the user, or if Cython doesn't
9523 : * know how to convert the type"""
9524 : */
9525 :
9526 0 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9527 0 : PyObject *__pyx_v_struct = NULL;
9528 0 : PyObject *__pyx_v_bytesitem = 0;
9529 0 : PyObject *__pyx_v_result = NULL;
9530 0 : PyObject *__pyx_r = NULL;
9531 : __Pyx_RefNannyDeclarations
9532 0 : PyObject *__pyx_t_1 = NULL;
9533 0 : PyObject *__pyx_t_2 = NULL;
9534 0 : PyObject *__pyx_t_3 = NULL;
9535 0 : PyObject *__pyx_t_4 = NULL;
9536 0 : PyObject *__pyx_t_5 = NULL;
9537 0 : PyObject *__pyx_t_6 = NULL;
9538 0 : PyObject *__pyx_t_7 = NULL;
9539 0 : unsigned int __pyx_t_8;
9540 0 : Py_ssize_t __pyx_t_9;
9541 0 : int __pyx_t_10;
9542 0 : int __pyx_t_11;
9543 0 : int __pyx_lineno = 0;
9544 0 : const char *__pyx_filename = NULL;
9545 0 : int __pyx_clineno = 0;
9546 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
9547 :
9548 : /* "View.MemoryView":492
9549 : * """Only used if instantiated manually by the user, or if Cython doesn't
9550 : * know how to convert the type"""
9551 : * import struct # <<<<<<<<<<<<<<
9552 : * cdef bytes bytesitem
9553 : *
9554 : */
9555 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
9556 0 : __Pyx_GOTREF(__pyx_t_1);
9557 0 : __pyx_v_struct = __pyx_t_1;
9558 0 : __pyx_t_1 = 0;
9559 :
9560 : /* "View.MemoryView":495
9561 : * cdef bytes bytesitem
9562 : *
9563 : * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9564 : * try:
9565 : * result = struct.unpack(self.view.format, bytesitem)
9566 : */
9567 0 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
9568 0 : __Pyx_GOTREF(__pyx_t_1);
9569 0 : __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9570 0 : __pyx_t_1 = 0;
9571 :
9572 : /* "View.MemoryView":496
9573 : *
9574 : * bytesitem = itemp[:self.view.itemsize]
9575 : * try: # <<<<<<<<<<<<<<
9576 : * result = struct.unpack(self.view.format, bytesitem)
9577 : * except struct.error:
9578 : */
9579 : {
9580 0 : __Pyx_PyThreadState_declare
9581 0 : __Pyx_PyThreadState_assign
9582 0 : __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9583 0 : __Pyx_XGOTREF(__pyx_t_2);
9584 0 : __Pyx_XGOTREF(__pyx_t_3);
9585 0 : __Pyx_XGOTREF(__pyx_t_4);
9586 : /*try:*/ {
9587 :
9588 : /* "View.MemoryView":497
9589 : * bytesitem = itemp[:self.view.itemsize]
9590 : * try:
9591 : * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9592 : * except struct.error:
9593 : * raise ValueError, "Unable to convert item to object"
9594 : */
9595 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
9596 0 : __Pyx_GOTREF(__pyx_t_5);
9597 0 : __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
9598 0 : __Pyx_GOTREF(__pyx_t_6);
9599 0 : __pyx_t_7 = NULL;
9600 0 : __pyx_t_8 = 0;
9601 : #if CYTHON_UNPACK_METHODS
9602 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9603 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
9604 0 : if (likely(__pyx_t_7)) {
9605 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9606 0 : __Pyx_INCREF(__pyx_t_7);
9607 0 : __Pyx_INCREF(function);
9608 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9609 : __pyx_t_8 = 1;
9610 : }
9611 : }
9612 : #endif
9613 : {
9614 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9615 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
9616 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9617 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9618 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
9619 0 : __Pyx_GOTREF(__pyx_t_1);
9620 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9621 : }
9622 0 : __pyx_v_result = __pyx_t_1;
9623 0 : __pyx_t_1 = 0;
9624 :
9625 : /* "View.MemoryView":496
9626 : *
9627 : * bytesitem = itemp[:self.view.itemsize]
9628 : * try: # <<<<<<<<<<<<<<
9629 : * result = struct.unpack(self.view.format, bytesitem)
9630 : * except struct.error:
9631 : */
9632 : }
9633 :
9634 : /* "View.MemoryView":501
9635 : * raise ValueError, "Unable to convert item to object"
9636 : * else:
9637 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9638 : * return result[0]
9639 : * return result
9640 : */
9641 : /*else:*/ {
9642 0 : __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
9643 0 : __pyx_t_10 = (__pyx_t_9 == 1);
9644 0 : if (__pyx_t_10) {
9645 :
9646 : /* "View.MemoryView":502
9647 : * else:
9648 : * if len(self.view.format) == 1:
9649 : * return result[0] # <<<<<<<<<<<<<<
9650 : * return result
9651 : *
9652 : */
9653 0 : __Pyx_XDECREF(__pyx_r);
9654 0 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
9655 0 : __Pyx_GOTREF(__pyx_t_1);
9656 0 : __pyx_r = __pyx_t_1;
9657 0 : __pyx_t_1 = 0;
9658 0 : goto __pyx_L6_except_return;
9659 :
9660 : /* "View.MemoryView":501
9661 : * raise ValueError, "Unable to convert item to object"
9662 : * else:
9663 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9664 : * return result[0]
9665 : * return result
9666 : */
9667 : }
9668 :
9669 : /* "View.MemoryView":503
9670 : * if len(self.view.format) == 1:
9671 : * return result[0]
9672 : * return result # <<<<<<<<<<<<<<
9673 : *
9674 : * cdef assign_item_from_object(self, char *itemp, object value):
9675 : */
9676 0 : __Pyx_XDECREF(__pyx_r);
9677 0 : __Pyx_INCREF(__pyx_v_result);
9678 0 : __pyx_r = __pyx_v_result;
9679 0 : goto __pyx_L6_except_return;
9680 : }
9681 0 : __pyx_L3_error:;
9682 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9683 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9684 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9685 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9686 :
9687 : /* "View.MemoryView":498
9688 : * try:
9689 : * result = struct.unpack(self.view.format, bytesitem)
9690 : * except struct.error: # <<<<<<<<<<<<<<
9691 : * raise ValueError, "Unable to convert item to object"
9692 : * else:
9693 : */
9694 0 : __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
9695 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
9696 0 : __Pyx_GOTREF(__pyx_t_7);
9697 0 : __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
9698 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9699 0 : __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
9700 0 : __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
9701 0 : if (__pyx_t_11) {
9702 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9703 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
9704 0 : __Pyx_XGOTREF(__pyx_t_6);
9705 0 : __Pyx_XGOTREF(__pyx_t_5);
9706 0 : __Pyx_XGOTREF(__pyx_t_1);
9707 :
9708 : /* "View.MemoryView":499
9709 : * result = struct.unpack(self.view.format, bytesitem)
9710 : * except struct.error:
9711 : * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
9712 : * else:
9713 : * if len(self.view.format) == 1:
9714 : */
9715 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
9716 0 : __PYX_ERR(1, 499, __pyx_L5_except_error)
9717 : }
9718 0 : goto __pyx_L5_except_error;
9719 :
9720 : /* "View.MemoryView":496
9721 : *
9722 : * bytesitem = itemp[:self.view.itemsize]
9723 : * try: # <<<<<<<<<<<<<<
9724 : * result = struct.unpack(self.view.format, bytesitem)
9725 : * except struct.error:
9726 : */
9727 0 : __pyx_L5_except_error:;
9728 0 : __Pyx_XGIVEREF(__pyx_t_2);
9729 0 : __Pyx_XGIVEREF(__pyx_t_3);
9730 0 : __Pyx_XGIVEREF(__pyx_t_4);
9731 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9732 0 : goto __pyx_L1_error;
9733 0 : __pyx_L6_except_return:;
9734 0 : __Pyx_XGIVEREF(__pyx_t_2);
9735 0 : __Pyx_XGIVEREF(__pyx_t_3);
9736 0 : __Pyx_XGIVEREF(__pyx_t_4);
9737 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9738 0 : goto __pyx_L0;
9739 : }
9740 :
9741 : /* "View.MemoryView":489
9742 : * self.assign_item_from_object(itemp, value)
9743 : *
9744 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9745 : * """Only used if instantiated manually by the user, or if Cython doesn't
9746 : * know how to convert the type"""
9747 : */
9748 :
9749 : /* function exit code */
9750 0 : __pyx_L1_error:;
9751 0 : __Pyx_XDECREF(__pyx_t_1);
9752 0 : __Pyx_XDECREF(__pyx_t_5);
9753 0 : __Pyx_XDECREF(__pyx_t_6);
9754 0 : __Pyx_XDECREF(__pyx_t_7);
9755 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9756 0 : __pyx_r = 0;
9757 0 : __pyx_L0:;
9758 0 : __Pyx_XDECREF(__pyx_v_struct);
9759 0 : __Pyx_XDECREF(__pyx_v_bytesitem);
9760 0 : __Pyx_XDECREF(__pyx_v_result);
9761 0 : __Pyx_XGIVEREF(__pyx_r);
9762 0 : __Pyx_RefNannyFinishContext();
9763 0 : return __pyx_r;
9764 : }
9765 :
9766 : /* "View.MemoryView":505
9767 : * return result
9768 : *
9769 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9770 : * """Only used if instantiated manually by the user, or if Cython doesn't
9771 : * know how to convert the type"""
9772 : */
9773 :
9774 0 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9775 0 : PyObject *__pyx_v_struct = NULL;
9776 0 : char __pyx_v_c;
9777 0 : PyObject *__pyx_v_bytesvalue = 0;
9778 0 : Py_ssize_t __pyx_v_i;
9779 0 : PyObject *__pyx_r = NULL;
9780 : __Pyx_RefNannyDeclarations
9781 0 : PyObject *__pyx_t_1 = NULL;
9782 0 : int __pyx_t_2;
9783 0 : PyObject *__pyx_t_3 = NULL;
9784 0 : PyObject *__pyx_t_4 = NULL;
9785 0 : PyObject *__pyx_t_5 = NULL;
9786 0 : unsigned int __pyx_t_6;
9787 0 : Py_ssize_t __pyx_t_7;
9788 0 : PyObject *__pyx_t_8 = NULL;
9789 0 : char *__pyx_t_9;
9790 0 : char *__pyx_t_10;
9791 0 : char *__pyx_t_11;
9792 0 : char *__pyx_t_12;
9793 0 : int __pyx_lineno = 0;
9794 0 : const char *__pyx_filename = NULL;
9795 0 : int __pyx_clineno = 0;
9796 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
9797 :
9798 : /* "View.MemoryView":508
9799 : * """Only used if instantiated manually by the user, or if Cython doesn't
9800 : * know how to convert the type"""
9801 : * import struct # <<<<<<<<<<<<<<
9802 : * cdef char c
9803 : * cdef bytes bytesvalue
9804 : */
9805 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
9806 0 : __Pyx_GOTREF(__pyx_t_1);
9807 0 : __pyx_v_struct = __pyx_t_1;
9808 0 : __pyx_t_1 = 0;
9809 :
9810 : /* "View.MemoryView":513
9811 : * cdef Py_ssize_t i
9812 : *
9813 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9814 : * bytesvalue = struct.pack(self.view.format, *value)
9815 : * else:
9816 : */
9817 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_value);
9818 0 : if (__pyx_t_2) {
9819 :
9820 : /* "View.MemoryView":514
9821 : *
9822 : * if isinstance(value, tuple):
9823 : * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9824 : * else:
9825 : * bytesvalue = struct.pack(self.view.format, value)
9826 : */
9827 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
9828 0 : __Pyx_GOTREF(__pyx_t_1);
9829 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9830 0 : __Pyx_GOTREF(__pyx_t_3);
9831 0 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
9832 0 : __Pyx_GOTREF(__pyx_t_4);
9833 0 : __Pyx_GIVEREF(__pyx_t_3);
9834 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error);
9835 0 : __pyx_t_3 = 0;
9836 0 : __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9837 0 : __Pyx_GOTREF(__pyx_t_3);
9838 0 : __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
9839 0 : __Pyx_GOTREF(__pyx_t_5);
9840 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9841 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9842 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9843 0 : __Pyx_GOTREF(__pyx_t_3);
9844 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9845 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9846 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
9847 0 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9848 0 : __pyx_t_3 = 0;
9849 :
9850 : /* "View.MemoryView":513
9851 : * cdef Py_ssize_t i
9852 : *
9853 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9854 : * bytesvalue = struct.pack(self.view.format, *value)
9855 : * else:
9856 : */
9857 0 : goto __pyx_L3;
9858 : }
9859 :
9860 : /* "View.MemoryView":516
9861 : * bytesvalue = struct.pack(self.view.format, *value)
9862 : * else:
9863 : * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9864 : *
9865 : * for i, c in enumerate(bytesvalue):
9866 : */
9867 : /*else*/ {
9868 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
9869 0 : __Pyx_GOTREF(__pyx_t_5);
9870 0 : __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
9871 0 : __Pyx_GOTREF(__pyx_t_1);
9872 0 : __pyx_t_4 = NULL;
9873 0 : __pyx_t_6 = 0;
9874 : #if CYTHON_UNPACK_METHODS
9875 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9876 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
9877 0 : if (likely(__pyx_t_4)) {
9878 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9879 0 : __Pyx_INCREF(__pyx_t_4);
9880 0 : __Pyx_INCREF(function);
9881 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9882 : __pyx_t_6 = 1;
9883 : }
9884 : }
9885 : #endif
9886 : {
9887 0 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
9888 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
9889 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9890 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9891 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
9892 0 : __Pyx_GOTREF(__pyx_t_3);
9893 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9894 : }
9895 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
9896 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9897 : __pyx_t_3 = 0;
9898 : }
9899 0 : __pyx_L3:;
9900 :
9901 : /* "View.MemoryView":518
9902 : * bytesvalue = struct.pack(self.view.format, value)
9903 : *
9904 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9905 : * itemp[i] = c
9906 : *
9907 : */
9908 0 : __pyx_t_7 = 0;
9909 0 : if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9910 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
9911 0 : __PYX_ERR(1, 518, __pyx_L1_error)
9912 : }
9913 0 : __Pyx_INCREF(__pyx_v_bytesvalue);
9914 0 : __pyx_t_8 = __pyx_v_bytesvalue;
9915 0 : __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
9916 0 : __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
9917 0 : for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
9918 0 : __pyx_t_9 = __pyx_t_12;
9919 0 : __pyx_v_c = (__pyx_t_9[0]);
9920 :
9921 : /* "View.MemoryView":519
9922 : *
9923 : * for i, c in enumerate(bytesvalue):
9924 : * itemp[i] = c # <<<<<<<<<<<<<<
9925 : *
9926 : * @cname('getbuffer')
9927 : */
9928 0 : __pyx_v_i = __pyx_t_7;
9929 :
9930 : /* "View.MemoryView":518
9931 : * bytesvalue = struct.pack(self.view.format, value)
9932 : *
9933 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9934 : * itemp[i] = c
9935 : *
9936 : */
9937 0 : __pyx_t_7 = (__pyx_t_7 + 1);
9938 :
9939 : /* "View.MemoryView":519
9940 : *
9941 : * for i, c in enumerate(bytesvalue):
9942 : * itemp[i] = c # <<<<<<<<<<<<<<
9943 : *
9944 : * @cname('getbuffer')
9945 : */
9946 0 : (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9947 : }
9948 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9949 :
9950 : /* "View.MemoryView":505
9951 : * return result
9952 : *
9953 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9954 : * """Only used if instantiated manually by the user, or if Cython doesn't
9955 : * know how to convert the type"""
9956 : */
9957 :
9958 : /* function exit code */
9959 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9960 0 : goto __pyx_L0;
9961 0 : __pyx_L1_error:;
9962 0 : __Pyx_XDECREF(__pyx_t_1);
9963 0 : __Pyx_XDECREF(__pyx_t_3);
9964 0 : __Pyx_XDECREF(__pyx_t_4);
9965 0 : __Pyx_XDECREF(__pyx_t_5);
9966 0 : __Pyx_XDECREF(__pyx_t_8);
9967 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9968 0 : __pyx_r = 0;
9969 0 : __pyx_L0:;
9970 0 : __Pyx_XDECREF(__pyx_v_struct);
9971 0 : __Pyx_XDECREF(__pyx_v_bytesvalue);
9972 0 : __Pyx_XGIVEREF(__pyx_r);
9973 0 : __Pyx_RefNannyFinishContext();
9974 0 : return __pyx_r;
9975 : }
9976 :
9977 : /* "View.MemoryView":521
9978 : * itemp[i] = c
9979 : *
9980 : * @cname('getbuffer') # <<<<<<<<<<<<<<
9981 : * def __getbuffer__(self, Py_buffer *info, int flags):
9982 : * if flags & PyBUF_WRITABLE and self.view.readonly:
9983 : */
9984 :
9985 : /* Python wrapper */
9986 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9987 21 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9988 21 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9989 21 : int __pyx_r;
9990 : __Pyx_RefNannyDeclarations
9991 21 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9992 21 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9993 21 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9994 :
9995 : /* function exit code */
9996 21 : __Pyx_RefNannyFinishContext();
9997 21 : return __pyx_r;
9998 : }
9999 :
10000 21 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10001 21 : int __pyx_r;
10002 : __Pyx_RefNannyDeclarations
10003 21 : int __pyx_t_1;
10004 21 : int __pyx_t_2;
10005 21 : Py_ssize_t *__pyx_t_3;
10006 21 : char *__pyx_t_4;
10007 21 : void *__pyx_t_5;
10008 21 : int __pyx_t_6;
10009 21 : Py_ssize_t __pyx_t_7;
10010 21 : int __pyx_lineno = 0;
10011 21 : const char *__pyx_filename = NULL;
10012 21 : int __pyx_clineno = 0;
10013 21 : if (unlikely(__pyx_v_info == NULL)) {
10014 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10015 0 : return -1;
10016 : }
10017 21 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
10018 21 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10019 21 : __Pyx_GIVEREF(__pyx_v_info->obj);
10020 :
10021 : /* "View.MemoryView":523
10022 : * @cname('getbuffer')
10023 : * def __getbuffer__(self, Py_buffer *info, int flags):
10024 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10025 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10026 : *
10027 : */
10028 21 : __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10029 21 : if (__pyx_t_2) {
10030 0 : } else {
10031 21 : __pyx_t_1 = __pyx_t_2;
10032 21 : goto __pyx_L4_bool_binop_done;
10033 : }
10034 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
10035 21 : __pyx_L4_bool_binop_done:;
10036 21 : if (unlikely(__pyx_t_1)) {
10037 :
10038 : /* "View.MemoryView":524
10039 : * def __getbuffer__(self, Py_buffer *info, int flags):
10040 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10041 : * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
10042 : *
10043 : * if flags & PyBUF_ND:
10044 : */
10045 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
10046 0 : __PYX_ERR(1, 524, __pyx_L1_error)
10047 :
10048 : /* "View.MemoryView":523
10049 : * @cname('getbuffer')
10050 : * def __getbuffer__(self, Py_buffer *info, int flags):
10051 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10052 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10053 : *
10054 : */
10055 : }
10056 :
10057 : /* "View.MemoryView":526
10058 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10059 : *
10060 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10061 : * info.shape = self.view.shape
10062 : * else:
10063 : */
10064 21 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10065 21 : if (__pyx_t_1) {
10066 :
10067 : /* "View.MemoryView":527
10068 : *
10069 : * if flags & PyBUF_ND:
10070 : * info.shape = self.view.shape # <<<<<<<<<<<<<<
10071 : * else:
10072 : * info.shape = NULL
10073 : */
10074 21 : __pyx_t_3 = __pyx_v_self->view.shape;
10075 21 : __pyx_v_info->shape = __pyx_t_3;
10076 :
10077 : /* "View.MemoryView":526
10078 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10079 : *
10080 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10081 : * info.shape = self.view.shape
10082 : * else:
10083 : */
10084 21 : goto __pyx_L6;
10085 : }
10086 :
10087 : /* "View.MemoryView":529
10088 : * info.shape = self.view.shape
10089 : * else:
10090 : * info.shape = NULL # <<<<<<<<<<<<<<
10091 : *
10092 : * if flags & PyBUF_STRIDES:
10093 : */
10094 : /*else*/ {
10095 0 : __pyx_v_info->shape = NULL;
10096 : }
10097 21 : __pyx_L6:;
10098 :
10099 : /* "View.MemoryView":531
10100 : * info.shape = NULL
10101 : *
10102 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10103 : * info.strides = self.view.strides
10104 : * else:
10105 : */
10106 21 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10107 21 : if (__pyx_t_1) {
10108 :
10109 : /* "View.MemoryView":532
10110 : *
10111 : * if flags & PyBUF_STRIDES:
10112 : * info.strides = self.view.strides # <<<<<<<<<<<<<<
10113 : * else:
10114 : * info.strides = NULL
10115 : */
10116 21 : __pyx_t_3 = __pyx_v_self->view.strides;
10117 21 : __pyx_v_info->strides = __pyx_t_3;
10118 :
10119 : /* "View.MemoryView":531
10120 : * info.shape = NULL
10121 : *
10122 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10123 : * info.strides = self.view.strides
10124 : * else:
10125 : */
10126 21 : goto __pyx_L7;
10127 : }
10128 :
10129 : /* "View.MemoryView":534
10130 : * info.strides = self.view.strides
10131 : * else:
10132 : * info.strides = NULL # <<<<<<<<<<<<<<
10133 : *
10134 : * if flags & PyBUF_INDIRECT:
10135 : */
10136 : /*else*/ {
10137 0 : __pyx_v_info->strides = NULL;
10138 : }
10139 21 : __pyx_L7:;
10140 :
10141 : /* "View.MemoryView":536
10142 : * info.strides = NULL
10143 : *
10144 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10145 : * info.suboffsets = self.view.suboffsets
10146 : * else:
10147 : */
10148 21 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10149 21 : if (__pyx_t_1) {
10150 :
10151 : /* "View.MemoryView":537
10152 : *
10153 : * if flags & PyBUF_INDIRECT:
10154 : * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10155 : * else:
10156 : * info.suboffsets = NULL
10157 : */
10158 21 : __pyx_t_3 = __pyx_v_self->view.suboffsets;
10159 21 : __pyx_v_info->suboffsets = __pyx_t_3;
10160 :
10161 : /* "View.MemoryView":536
10162 : * info.strides = NULL
10163 : *
10164 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10165 : * info.suboffsets = self.view.suboffsets
10166 : * else:
10167 : */
10168 21 : goto __pyx_L8;
10169 : }
10170 :
10171 : /* "View.MemoryView":539
10172 : * info.suboffsets = self.view.suboffsets
10173 : * else:
10174 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
10175 : *
10176 : * if flags & PyBUF_FORMAT:
10177 : */
10178 : /*else*/ {
10179 0 : __pyx_v_info->suboffsets = NULL;
10180 : }
10181 21 : __pyx_L8:;
10182 :
10183 : /* "View.MemoryView":541
10184 : * info.suboffsets = NULL
10185 : *
10186 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10187 : * info.format = self.view.format
10188 : * else:
10189 : */
10190 21 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10191 21 : if (__pyx_t_1) {
10192 :
10193 : /* "View.MemoryView":542
10194 : *
10195 : * if flags & PyBUF_FORMAT:
10196 : * info.format = self.view.format # <<<<<<<<<<<<<<
10197 : * else:
10198 : * info.format = NULL
10199 : */
10200 21 : __pyx_t_4 = __pyx_v_self->view.format;
10201 21 : __pyx_v_info->format = __pyx_t_4;
10202 :
10203 : /* "View.MemoryView":541
10204 : * info.suboffsets = NULL
10205 : *
10206 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10207 : * info.format = self.view.format
10208 : * else:
10209 : */
10210 21 : goto __pyx_L9;
10211 : }
10212 :
10213 : /* "View.MemoryView":544
10214 : * info.format = self.view.format
10215 : * else:
10216 : * info.format = NULL # <<<<<<<<<<<<<<
10217 : *
10218 : * info.buf = self.view.buf
10219 : */
10220 : /*else*/ {
10221 0 : __pyx_v_info->format = NULL;
10222 : }
10223 21 : __pyx_L9:;
10224 :
10225 : /* "View.MemoryView":546
10226 : * info.format = NULL
10227 : *
10228 : * info.buf = self.view.buf # <<<<<<<<<<<<<<
10229 : * info.ndim = self.view.ndim
10230 : * info.itemsize = self.view.itemsize
10231 : */
10232 21 : __pyx_t_5 = __pyx_v_self->view.buf;
10233 21 : __pyx_v_info->buf = __pyx_t_5;
10234 :
10235 : /* "View.MemoryView":547
10236 : *
10237 : * info.buf = self.view.buf
10238 : * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10239 : * info.itemsize = self.view.itemsize
10240 : * info.len = self.view.len
10241 : */
10242 21 : __pyx_t_6 = __pyx_v_self->view.ndim;
10243 21 : __pyx_v_info->ndim = __pyx_t_6;
10244 :
10245 : /* "View.MemoryView":548
10246 : * info.buf = self.view.buf
10247 : * info.ndim = self.view.ndim
10248 : * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10249 : * info.len = self.view.len
10250 : * info.readonly = self.view.readonly
10251 : */
10252 21 : __pyx_t_7 = __pyx_v_self->view.itemsize;
10253 21 : __pyx_v_info->itemsize = __pyx_t_7;
10254 :
10255 : /* "View.MemoryView":549
10256 : * info.ndim = self.view.ndim
10257 : * info.itemsize = self.view.itemsize
10258 : * info.len = self.view.len # <<<<<<<<<<<<<<
10259 : * info.readonly = self.view.readonly
10260 : * info.obj = self
10261 : */
10262 21 : __pyx_t_7 = __pyx_v_self->view.len;
10263 21 : __pyx_v_info->len = __pyx_t_7;
10264 :
10265 : /* "View.MemoryView":550
10266 : * info.itemsize = self.view.itemsize
10267 : * info.len = self.view.len
10268 : * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10269 : * info.obj = self
10270 : *
10271 : */
10272 21 : __pyx_t_1 = __pyx_v_self->view.readonly;
10273 21 : __pyx_v_info->readonly = __pyx_t_1;
10274 :
10275 : /* "View.MemoryView":551
10276 : * info.len = self.view.len
10277 : * info.readonly = self.view.readonly
10278 : * info.obj = self # <<<<<<<<<<<<<<
10279 : *
10280 : *
10281 : */
10282 21 : __Pyx_INCREF((PyObject *)__pyx_v_self);
10283 21 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10284 21 : __Pyx_GOTREF(__pyx_v_info->obj);
10285 21 : __Pyx_DECREF(__pyx_v_info->obj);
10286 21 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10287 :
10288 : /* "View.MemoryView":521
10289 : * itemp[i] = c
10290 : *
10291 : * @cname('getbuffer') # <<<<<<<<<<<<<<
10292 : * def __getbuffer__(self, Py_buffer *info, int flags):
10293 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10294 : */
10295 :
10296 : /* function exit code */
10297 21 : __pyx_r = 0;
10298 21 : goto __pyx_L0;
10299 0 : __pyx_L1_error:;
10300 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10301 0 : __pyx_r = -1;
10302 0 : if (__pyx_v_info->obj != NULL) {
10303 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10304 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10305 : }
10306 0 : goto __pyx_L2;
10307 21 : __pyx_L0:;
10308 21 : if (__pyx_v_info->obj == Py_None) {
10309 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10310 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10311 : }
10312 21 : __pyx_L2:;
10313 : __Pyx_RefNannyFinishContext();
10314 : return __pyx_r;
10315 : }
10316 :
10317 : /* "View.MemoryView":554
10318 : *
10319 : *
10320 : * @property # <<<<<<<<<<<<<<
10321 : * def T(self):
10322 : * cdef _memoryviewslice result = memoryview_copy(self)
10323 : */
10324 :
10325 : /* Python wrapper */
10326 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10327 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10328 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10329 0 : PyObject *__pyx_r = 0;
10330 : __Pyx_RefNannyDeclarations
10331 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10332 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10333 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10334 :
10335 : /* function exit code */
10336 0 : __Pyx_RefNannyFinishContext();
10337 0 : return __pyx_r;
10338 : }
10339 :
10340 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10341 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10342 0 : PyObject *__pyx_r = NULL;
10343 : __Pyx_RefNannyDeclarations
10344 0 : PyObject *__pyx_t_1 = NULL;
10345 0 : int __pyx_t_2;
10346 0 : int __pyx_lineno = 0;
10347 0 : const char *__pyx_filename = NULL;
10348 0 : int __pyx_clineno = 0;
10349 0 : __Pyx_RefNannySetupContext("__get__", 1);
10350 :
10351 : /* "View.MemoryView":556
10352 : * @property
10353 : * def T(self):
10354 : * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10355 : * transpose_memslice(&result.from_slice)
10356 : * return result
10357 : */
10358 0 : __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
10359 0 : __Pyx_GOTREF(__pyx_t_1);
10360 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
10361 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10362 0 : __pyx_t_1 = 0;
10363 :
10364 : /* "View.MemoryView":557
10365 : * def T(self):
10366 : * cdef _memoryviewslice result = memoryview_copy(self)
10367 : * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10368 : * return result
10369 : *
10370 : */
10371 0 : __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
10372 :
10373 : /* "View.MemoryView":558
10374 : * cdef _memoryviewslice result = memoryview_copy(self)
10375 : * transpose_memslice(&result.from_slice)
10376 : * return result # <<<<<<<<<<<<<<
10377 : *
10378 : * @property
10379 : */
10380 0 : __Pyx_XDECREF(__pyx_r);
10381 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
10382 0 : __pyx_r = ((PyObject *)__pyx_v_result);
10383 0 : goto __pyx_L0;
10384 :
10385 : /* "View.MemoryView":554
10386 : *
10387 : *
10388 : * @property # <<<<<<<<<<<<<<
10389 : * def T(self):
10390 : * cdef _memoryviewslice result = memoryview_copy(self)
10391 : */
10392 :
10393 : /* function exit code */
10394 0 : __pyx_L1_error:;
10395 0 : __Pyx_XDECREF(__pyx_t_1);
10396 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10397 0 : __pyx_r = NULL;
10398 0 : __pyx_L0:;
10399 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
10400 0 : __Pyx_XGIVEREF(__pyx_r);
10401 0 : __Pyx_RefNannyFinishContext();
10402 0 : return __pyx_r;
10403 : }
10404 :
10405 : /* "View.MemoryView":560
10406 : * return result
10407 : *
10408 : * @property # <<<<<<<<<<<<<<
10409 : * def base(self):
10410 : * return self._get_base()
10411 : */
10412 :
10413 : /* Python wrapper */
10414 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10415 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10416 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10417 0 : PyObject *__pyx_r = 0;
10418 : __Pyx_RefNannyDeclarations
10419 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10420 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10421 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10422 :
10423 : /* function exit code */
10424 0 : __Pyx_RefNannyFinishContext();
10425 0 : return __pyx_r;
10426 : }
10427 :
10428 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10429 0 : PyObject *__pyx_r = NULL;
10430 : __Pyx_RefNannyDeclarations
10431 0 : PyObject *__pyx_t_1 = NULL;
10432 0 : int __pyx_lineno = 0;
10433 0 : const char *__pyx_filename = NULL;
10434 0 : int __pyx_clineno = 0;
10435 0 : __Pyx_RefNannySetupContext("__get__", 1);
10436 :
10437 : /* "View.MemoryView":562
10438 : * @property
10439 : * def base(self):
10440 : * return self._get_base() # <<<<<<<<<<<<<<
10441 : *
10442 : * cdef _get_base(self):
10443 : */
10444 0 : __Pyx_XDECREF(__pyx_r);
10445 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
10446 0 : __Pyx_GOTREF(__pyx_t_1);
10447 0 : __pyx_r = __pyx_t_1;
10448 0 : __pyx_t_1 = 0;
10449 0 : goto __pyx_L0;
10450 :
10451 : /* "View.MemoryView":560
10452 : * return result
10453 : *
10454 : * @property # <<<<<<<<<<<<<<
10455 : * def base(self):
10456 : * return self._get_base()
10457 : */
10458 :
10459 : /* function exit code */
10460 0 : __pyx_L1_error:;
10461 0 : __Pyx_XDECREF(__pyx_t_1);
10462 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10463 0 : __pyx_r = NULL;
10464 0 : __pyx_L0:;
10465 0 : __Pyx_XGIVEREF(__pyx_r);
10466 0 : __Pyx_RefNannyFinishContext();
10467 0 : return __pyx_r;
10468 : }
10469 :
10470 : /* "View.MemoryView":564
10471 : * return self._get_base()
10472 : *
10473 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10474 : * return self.obj
10475 : *
10476 : */
10477 :
10478 29 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10479 29 : PyObject *__pyx_r = NULL;
10480 : __Pyx_RefNannyDeclarations
10481 29 : __Pyx_RefNannySetupContext("_get_base", 1);
10482 :
10483 : /* "View.MemoryView":565
10484 : *
10485 : * cdef _get_base(self):
10486 : * return self.obj # <<<<<<<<<<<<<<
10487 : *
10488 : * @property
10489 : */
10490 29 : __Pyx_XDECREF(__pyx_r);
10491 29 : __Pyx_INCREF(__pyx_v_self->obj);
10492 29 : __pyx_r = __pyx_v_self->obj;
10493 29 : goto __pyx_L0;
10494 :
10495 : /* "View.MemoryView":564
10496 : * return self._get_base()
10497 : *
10498 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10499 : * return self.obj
10500 : *
10501 : */
10502 :
10503 : /* function exit code */
10504 29 : __pyx_L0:;
10505 29 : __Pyx_XGIVEREF(__pyx_r);
10506 29 : __Pyx_RefNannyFinishContext();
10507 29 : return __pyx_r;
10508 : }
10509 :
10510 : /* "View.MemoryView":567
10511 : * return self.obj
10512 : *
10513 : * @property # <<<<<<<<<<<<<<
10514 : * def shape(self):
10515 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10516 : */
10517 :
10518 : /* Python wrapper */
10519 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10520 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10521 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10522 0 : PyObject *__pyx_r = 0;
10523 : __Pyx_RefNannyDeclarations
10524 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10525 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10526 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10527 :
10528 : /* function exit code */
10529 0 : __Pyx_RefNannyFinishContext();
10530 0 : return __pyx_r;
10531 : }
10532 :
10533 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10534 0 : Py_ssize_t __pyx_7genexpr__pyx_v_length;
10535 0 : PyObject *__pyx_r = NULL;
10536 : __Pyx_RefNannyDeclarations
10537 0 : PyObject *__pyx_t_1 = NULL;
10538 0 : Py_ssize_t *__pyx_t_2;
10539 0 : Py_ssize_t *__pyx_t_3;
10540 0 : Py_ssize_t *__pyx_t_4;
10541 0 : PyObject *__pyx_t_5 = NULL;
10542 0 : int __pyx_lineno = 0;
10543 0 : const char *__pyx_filename = NULL;
10544 0 : int __pyx_clineno = 0;
10545 0 : __Pyx_RefNannySetupContext("__get__", 1);
10546 :
10547 : /* "View.MemoryView":569
10548 : * @property
10549 : * def shape(self):
10550 : * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10551 : *
10552 : * @property
10553 : */
10554 0 : __Pyx_XDECREF(__pyx_r);
10555 : { /* enter inner scope */
10556 0 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
10557 0 : __Pyx_GOTREF(__pyx_t_1);
10558 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10559 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10560 0 : __pyx_t_2 = __pyx_t_4;
10561 0 : __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10562 0 : __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10563 0 : __Pyx_GOTREF(__pyx_t_5);
10564 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
10565 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10566 : }
10567 : } /* exit inner scope */
10568 0 : __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10569 0 : __Pyx_GOTREF(__pyx_t_5);
10570 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10571 0 : __pyx_r = __pyx_t_5;
10572 0 : __pyx_t_5 = 0;
10573 0 : goto __pyx_L0;
10574 :
10575 : /* "View.MemoryView":567
10576 : * return self.obj
10577 : *
10578 : * @property # <<<<<<<<<<<<<<
10579 : * def shape(self):
10580 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10581 : */
10582 :
10583 : /* function exit code */
10584 0 : __pyx_L1_error:;
10585 0 : __Pyx_XDECREF(__pyx_t_1);
10586 0 : __Pyx_XDECREF(__pyx_t_5);
10587 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10588 0 : __pyx_r = NULL;
10589 0 : __pyx_L0:;
10590 0 : __Pyx_XGIVEREF(__pyx_r);
10591 0 : __Pyx_RefNannyFinishContext();
10592 0 : return __pyx_r;
10593 : }
10594 :
10595 : /* "View.MemoryView":571
10596 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10597 : *
10598 : * @property # <<<<<<<<<<<<<<
10599 : * def strides(self):
10600 : * if self.view.strides == NULL:
10601 : */
10602 :
10603 : /* Python wrapper */
10604 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10605 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10606 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10607 0 : PyObject *__pyx_r = 0;
10608 : __Pyx_RefNannyDeclarations
10609 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10610 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10611 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10612 :
10613 : /* function exit code */
10614 0 : __Pyx_RefNannyFinishContext();
10615 0 : return __pyx_r;
10616 : }
10617 :
10618 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10619 0 : Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10620 0 : PyObject *__pyx_r = NULL;
10621 : __Pyx_RefNannyDeclarations
10622 0 : int __pyx_t_1;
10623 0 : PyObject *__pyx_t_2 = NULL;
10624 0 : Py_ssize_t *__pyx_t_3;
10625 0 : Py_ssize_t *__pyx_t_4;
10626 0 : Py_ssize_t *__pyx_t_5;
10627 0 : PyObject *__pyx_t_6 = NULL;
10628 0 : int __pyx_lineno = 0;
10629 0 : const char *__pyx_filename = NULL;
10630 0 : int __pyx_clineno = 0;
10631 0 : __Pyx_RefNannySetupContext("__get__", 1);
10632 :
10633 : /* "View.MemoryView":573
10634 : * @property
10635 : * def strides(self):
10636 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10637 : *
10638 : * raise ValueError, "Buffer view does not expose strides"
10639 : */
10640 0 : __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10641 0 : if (unlikely(__pyx_t_1)) {
10642 :
10643 : /* "View.MemoryView":575
10644 : * if self.view.strides == NULL:
10645 : *
10646 : * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
10647 : *
10648 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10649 : */
10650 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
10651 0 : __PYX_ERR(1, 575, __pyx_L1_error)
10652 :
10653 : /* "View.MemoryView":573
10654 : * @property
10655 : * def strides(self):
10656 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10657 : *
10658 : * raise ValueError, "Buffer view does not expose strides"
10659 : */
10660 : }
10661 :
10662 : /* "View.MemoryView":577
10663 : * raise ValueError, "Buffer view does not expose strides"
10664 : *
10665 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10666 : *
10667 : * @property
10668 : */
10669 0 : __Pyx_XDECREF(__pyx_r);
10670 : { /* enter inner scope */
10671 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
10672 0 : __Pyx_GOTREF(__pyx_t_2);
10673 0 : __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10674 0 : for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10675 0 : __pyx_t_3 = __pyx_t_5;
10676 0 : __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
10677 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10678 0 : __Pyx_GOTREF(__pyx_t_6);
10679 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
10680 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10681 : }
10682 : } /* exit inner scope */
10683 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10684 0 : __Pyx_GOTREF(__pyx_t_6);
10685 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10686 0 : __pyx_r = __pyx_t_6;
10687 0 : __pyx_t_6 = 0;
10688 0 : goto __pyx_L0;
10689 :
10690 : /* "View.MemoryView":571
10691 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10692 : *
10693 : * @property # <<<<<<<<<<<<<<
10694 : * def strides(self):
10695 : * if self.view.strides == NULL:
10696 : */
10697 :
10698 : /* function exit code */
10699 0 : __pyx_L1_error:;
10700 0 : __Pyx_XDECREF(__pyx_t_2);
10701 0 : __Pyx_XDECREF(__pyx_t_6);
10702 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10703 0 : __pyx_r = NULL;
10704 0 : __pyx_L0:;
10705 0 : __Pyx_XGIVEREF(__pyx_r);
10706 0 : __Pyx_RefNannyFinishContext();
10707 0 : return __pyx_r;
10708 : }
10709 :
10710 : /* "View.MemoryView":579
10711 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10712 : *
10713 : * @property # <<<<<<<<<<<<<<
10714 : * def suboffsets(self):
10715 : * if self.view.suboffsets == NULL:
10716 : */
10717 :
10718 : /* Python wrapper */
10719 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10720 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10721 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10722 0 : PyObject *__pyx_r = 0;
10723 : __Pyx_RefNannyDeclarations
10724 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10725 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10726 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10727 :
10728 : /* function exit code */
10729 0 : __Pyx_RefNannyFinishContext();
10730 0 : return __pyx_r;
10731 : }
10732 :
10733 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10734 0 : Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10735 0 : PyObject *__pyx_r = NULL;
10736 : __Pyx_RefNannyDeclarations
10737 0 : int __pyx_t_1;
10738 0 : PyObject *__pyx_t_2 = NULL;
10739 0 : Py_ssize_t *__pyx_t_3;
10740 0 : Py_ssize_t *__pyx_t_4;
10741 0 : Py_ssize_t *__pyx_t_5;
10742 0 : PyObject *__pyx_t_6 = NULL;
10743 0 : int __pyx_lineno = 0;
10744 0 : const char *__pyx_filename = NULL;
10745 0 : int __pyx_clineno = 0;
10746 0 : __Pyx_RefNannySetupContext("__get__", 1);
10747 :
10748 : /* "View.MemoryView":581
10749 : * @property
10750 : * def suboffsets(self):
10751 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10752 : * return (-1,) * self.view.ndim
10753 : *
10754 : */
10755 0 : __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10756 0 : if (__pyx_t_1) {
10757 :
10758 : /* "View.MemoryView":582
10759 : * def suboffsets(self):
10760 : * if self.view.suboffsets == NULL:
10761 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10762 : *
10763 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10764 : */
10765 0 : __Pyx_XDECREF(__pyx_r);
10766 0 : __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
10767 0 : __Pyx_GOTREF(__pyx_t_2);
10768 0 : __pyx_r = __pyx_t_2;
10769 0 : __pyx_t_2 = 0;
10770 0 : goto __pyx_L0;
10771 :
10772 : /* "View.MemoryView":581
10773 : * @property
10774 : * def suboffsets(self):
10775 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10776 : * return (-1,) * self.view.ndim
10777 : *
10778 : */
10779 : }
10780 :
10781 : /* "View.MemoryView":584
10782 : * return (-1,) * self.view.ndim
10783 : *
10784 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10785 : *
10786 : * @property
10787 : */
10788 0 : __Pyx_XDECREF(__pyx_r);
10789 : { /* enter inner scope */
10790 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
10791 0 : __Pyx_GOTREF(__pyx_t_2);
10792 0 : __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10793 0 : for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10794 0 : __pyx_t_3 = __pyx_t_5;
10795 0 : __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10796 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10797 0 : __Pyx_GOTREF(__pyx_t_6);
10798 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
10799 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10800 : }
10801 : } /* exit inner scope */
10802 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10803 0 : __Pyx_GOTREF(__pyx_t_6);
10804 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10805 0 : __pyx_r = __pyx_t_6;
10806 0 : __pyx_t_6 = 0;
10807 0 : goto __pyx_L0;
10808 :
10809 : /* "View.MemoryView":579
10810 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10811 : *
10812 : * @property # <<<<<<<<<<<<<<
10813 : * def suboffsets(self):
10814 : * if self.view.suboffsets == NULL:
10815 : */
10816 :
10817 : /* function exit code */
10818 0 : __pyx_L1_error:;
10819 0 : __Pyx_XDECREF(__pyx_t_2);
10820 0 : __Pyx_XDECREF(__pyx_t_6);
10821 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10822 0 : __pyx_r = NULL;
10823 0 : __pyx_L0:;
10824 0 : __Pyx_XGIVEREF(__pyx_r);
10825 0 : __Pyx_RefNannyFinishContext();
10826 0 : return __pyx_r;
10827 : }
10828 :
10829 : /* "View.MemoryView":586
10830 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10831 : *
10832 : * @property # <<<<<<<<<<<<<<
10833 : * def ndim(self):
10834 : * return self.view.ndim
10835 : */
10836 :
10837 : /* Python wrapper */
10838 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
10839 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10840 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10841 0 : PyObject *__pyx_r = 0;
10842 : __Pyx_RefNannyDeclarations
10843 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10844 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10845 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10846 :
10847 : /* function exit code */
10848 0 : __Pyx_RefNannyFinishContext();
10849 0 : return __pyx_r;
10850 : }
10851 :
10852 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10853 0 : PyObject *__pyx_r = NULL;
10854 : __Pyx_RefNannyDeclarations
10855 0 : PyObject *__pyx_t_1 = NULL;
10856 0 : int __pyx_lineno = 0;
10857 0 : const char *__pyx_filename = NULL;
10858 0 : int __pyx_clineno = 0;
10859 0 : __Pyx_RefNannySetupContext("__get__", 1);
10860 :
10861 : /* "View.MemoryView":588
10862 : * @property
10863 : * def ndim(self):
10864 : * return self.view.ndim # <<<<<<<<<<<<<<
10865 : *
10866 : * @property
10867 : */
10868 0 : __Pyx_XDECREF(__pyx_r);
10869 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
10870 0 : __Pyx_GOTREF(__pyx_t_1);
10871 0 : __pyx_r = __pyx_t_1;
10872 0 : __pyx_t_1 = 0;
10873 0 : goto __pyx_L0;
10874 :
10875 : /* "View.MemoryView":586
10876 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10877 : *
10878 : * @property # <<<<<<<<<<<<<<
10879 : * def ndim(self):
10880 : * return self.view.ndim
10881 : */
10882 :
10883 : /* function exit code */
10884 0 : __pyx_L1_error:;
10885 0 : __Pyx_XDECREF(__pyx_t_1);
10886 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10887 0 : __pyx_r = NULL;
10888 0 : __pyx_L0:;
10889 0 : __Pyx_XGIVEREF(__pyx_r);
10890 0 : __Pyx_RefNannyFinishContext();
10891 0 : return __pyx_r;
10892 : }
10893 :
10894 : /* "View.MemoryView":590
10895 : * return self.view.ndim
10896 : *
10897 : * @property # <<<<<<<<<<<<<<
10898 : * def itemsize(self):
10899 : * return self.view.itemsize
10900 : */
10901 :
10902 : /* Python wrapper */
10903 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
10904 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10905 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10906 0 : PyObject *__pyx_r = 0;
10907 : __Pyx_RefNannyDeclarations
10908 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10909 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10910 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10911 :
10912 : /* function exit code */
10913 0 : __Pyx_RefNannyFinishContext();
10914 0 : return __pyx_r;
10915 : }
10916 :
10917 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10918 0 : PyObject *__pyx_r = NULL;
10919 : __Pyx_RefNannyDeclarations
10920 0 : PyObject *__pyx_t_1 = NULL;
10921 0 : int __pyx_lineno = 0;
10922 0 : const char *__pyx_filename = NULL;
10923 0 : int __pyx_clineno = 0;
10924 0 : __Pyx_RefNannySetupContext("__get__", 1);
10925 :
10926 : /* "View.MemoryView":592
10927 : * @property
10928 : * def itemsize(self):
10929 : * return self.view.itemsize # <<<<<<<<<<<<<<
10930 : *
10931 : * @property
10932 : */
10933 0 : __Pyx_XDECREF(__pyx_r);
10934 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
10935 0 : __Pyx_GOTREF(__pyx_t_1);
10936 0 : __pyx_r = __pyx_t_1;
10937 0 : __pyx_t_1 = 0;
10938 0 : goto __pyx_L0;
10939 :
10940 : /* "View.MemoryView":590
10941 : * return self.view.ndim
10942 : *
10943 : * @property # <<<<<<<<<<<<<<
10944 : * def itemsize(self):
10945 : * return self.view.itemsize
10946 : */
10947 :
10948 : /* function exit code */
10949 0 : __pyx_L1_error:;
10950 0 : __Pyx_XDECREF(__pyx_t_1);
10951 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10952 0 : __pyx_r = NULL;
10953 0 : __pyx_L0:;
10954 0 : __Pyx_XGIVEREF(__pyx_r);
10955 0 : __Pyx_RefNannyFinishContext();
10956 0 : return __pyx_r;
10957 : }
10958 :
10959 : /* "View.MemoryView":594
10960 : * return self.view.itemsize
10961 : *
10962 : * @property # <<<<<<<<<<<<<<
10963 : * def nbytes(self):
10964 : * return self.size * self.view.itemsize
10965 : */
10966 :
10967 : /* Python wrapper */
10968 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
10969 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10970 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10971 0 : PyObject *__pyx_r = 0;
10972 : __Pyx_RefNannyDeclarations
10973 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10974 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10975 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10976 :
10977 : /* function exit code */
10978 0 : __Pyx_RefNannyFinishContext();
10979 0 : return __pyx_r;
10980 : }
10981 :
10982 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10983 0 : PyObject *__pyx_r = NULL;
10984 : __Pyx_RefNannyDeclarations
10985 0 : PyObject *__pyx_t_1 = NULL;
10986 0 : PyObject *__pyx_t_2 = NULL;
10987 0 : PyObject *__pyx_t_3 = NULL;
10988 0 : int __pyx_lineno = 0;
10989 0 : const char *__pyx_filename = NULL;
10990 0 : int __pyx_clineno = 0;
10991 0 : __Pyx_RefNannySetupContext("__get__", 1);
10992 :
10993 : /* "View.MemoryView":596
10994 : * @property
10995 : * def nbytes(self):
10996 : * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
10997 : *
10998 : * @property
10999 : */
11000 0 : __Pyx_XDECREF(__pyx_r);
11001 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
11002 0 : __Pyx_GOTREF(__pyx_t_1);
11003 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
11004 0 : __Pyx_GOTREF(__pyx_t_2);
11005 0 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
11006 0 : __Pyx_GOTREF(__pyx_t_3);
11007 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11008 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11009 0 : __pyx_r = __pyx_t_3;
11010 0 : __pyx_t_3 = 0;
11011 0 : goto __pyx_L0;
11012 :
11013 : /* "View.MemoryView":594
11014 : * return self.view.itemsize
11015 : *
11016 : * @property # <<<<<<<<<<<<<<
11017 : * def nbytes(self):
11018 : * return self.size * self.view.itemsize
11019 : */
11020 :
11021 : /* function exit code */
11022 0 : __pyx_L1_error:;
11023 0 : __Pyx_XDECREF(__pyx_t_1);
11024 0 : __Pyx_XDECREF(__pyx_t_2);
11025 0 : __Pyx_XDECREF(__pyx_t_3);
11026 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11027 0 : __pyx_r = NULL;
11028 0 : __pyx_L0:;
11029 0 : __Pyx_XGIVEREF(__pyx_r);
11030 0 : __Pyx_RefNannyFinishContext();
11031 0 : return __pyx_r;
11032 : }
11033 :
11034 : /* "View.MemoryView":598
11035 : * return self.size * self.view.itemsize
11036 : *
11037 : * @property # <<<<<<<<<<<<<<
11038 : * def size(self):
11039 : * if self._size is None:
11040 : */
11041 :
11042 : /* Python wrapper */
11043 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11044 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11045 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11046 0 : PyObject *__pyx_r = 0;
11047 : __Pyx_RefNannyDeclarations
11048 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11049 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11050 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11051 :
11052 : /* function exit code */
11053 0 : __Pyx_RefNannyFinishContext();
11054 0 : return __pyx_r;
11055 : }
11056 :
11057 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11058 0 : PyObject *__pyx_v_result = NULL;
11059 0 : PyObject *__pyx_v_length = NULL;
11060 0 : PyObject *__pyx_r = NULL;
11061 : __Pyx_RefNannyDeclarations
11062 0 : int __pyx_t_1;
11063 0 : Py_ssize_t *__pyx_t_2;
11064 0 : Py_ssize_t *__pyx_t_3;
11065 0 : Py_ssize_t *__pyx_t_4;
11066 0 : PyObject *__pyx_t_5 = NULL;
11067 0 : int __pyx_lineno = 0;
11068 0 : const char *__pyx_filename = NULL;
11069 0 : int __pyx_clineno = 0;
11070 0 : __Pyx_RefNannySetupContext("__get__", 1);
11071 :
11072 : /* "View.MemoryView":600
11073 : * @property
11074 : * def size(self):
11075 : * if self._size is None: # <<<<<<<<<<<<<<
11076 : * result = 1
11077 : *
11078 : */
11079 0 : __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11080 0 : if (__pyx_t_1) {
11081 :
11082 : /* "View.MemoryView":601
11083 : * def size(self):
11084 : * if self._size is None:
11085 : * result = 1 # <<<<<<<<<<<<<<
11086 : *
11087 : * for length in self.view.shape[:self.view.ndim]:
11088 : */
11089 0 : __Pyx_INCREF(__pyx_int_1);
11090 0 : __pyx_v_result = __pyx_int_1;
11091 :
11092 : /* "View.MemoryView":603
11093 : * result = 1
11094 : *
11095 : * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11096 : * result *= length
11097 : *
11098 : */
11099 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11100 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11101 0 : __pyx_t_2 = __pyx_t_4;
11102 0 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
11103 0 : __Pyx_GOTREF(__pyx_t_5);
11104 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
11105 0 : __pyx_t_5 = 0;
11106 :
11107 : /* "View.MemoryView":604
11108 : *
11109 : * for length in self.view.shape[:self.view.ndim]:
11110 : * result *= length # <<<<<<<<<<<<<<
11111 : *
11112 : * self._size = result
11113 : */
11114 0 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
11115 0 : __Pyx_GOTREF(__pyx_t_5);
11116 0 : __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
11117 0 : __pyx_t_5 = 0;
11118 : }
11119 :
11120 : /* "View.MemoryView":606
11121 : * result *= length
11122 : *
11123 : * self._size = result # <<<<<<<<<<<<<<
11124 : *
11125 : * return self._size
11126 : */
11127 0 : __Pyx_INCREF(__pyx_v_result);
11128 0 : __Pyx_GIVEREF(__pyx_v_result);
11129 0 : __Pyx_GOTREF(__pyx_v_self->_size);
11130 0 : __Pyx_DECREF(__pyx_v_self->_size);
11131 0 : __pyx_v_self->_size = __pyx_v_result;
11132 :
11133 : /* "View.MemoryView":600
11134 : * @property
11135 : * def size(self):
11136 : * if self._size is None: # <<<<<<<<<<<<<<
11137 : * result = 1
11138 : *
11139 : */
11140 : }
11141 :
11142 : /* "View.MemoryView":608
11143 : * self._size = result
11144 : *
11145 : * return self._size # <<<<<<<<<<<<<<
11146 : *
11147 : * def __len__(self):
11148 : */
11149 0 : __Pyx_XDECREF(__pyx_r);
11150 0 : __Pyx_INCREF(__pyx_v_self->_size);
11151 0 : __pyx_r = __pyx_v_self->_size;
11152 0 : goto __pyx_L0;
11153 :
11154 : /* "View.MemoryView":598
11155 : * return self.size * self.view.itemsize
11156 : *
11157 : * @property # <<<<<<<<<<<<<<
11158 : * def size(self):
11159 : * if self._size is None:
11160 : */
11161 :
11162 : /* function exit code */
11163 0 : __pyx_L1_error:;
11164 0 : __Pyx_XDECREF(__pyx_t_5);
11165 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11166 0 : __pyx_r = NULL;
11167 0 : __pyx_L0:;
11168 0 : __Pyx_XDECREF(__pyx_v_result);
11169 0 : __Pyx_XDECREF(__pyx_v_length);
11170 0 : __Pyx_XGIVEREF(__pyx_r);
11171 0 : __Pyx_RefNannyFinishContext();
11172 0 : return __pyx_r;
11173 : }
11174 :
11175 : /* "View.MemoryView":610
11176 : * return self._size
11177 : *
11178 : * def __len__(self): # <<<<<<<<<<<<<<
11179 : * if self.view.ndim >= 1:
11180 : * return self.view.shape[0]
11181 : */
11182 :
11183 : /* Python wrapper */
11184 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11185 0 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11186 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11187 0 : Py_ssize_t __pyx_r;
11188 : __Pyx_RefNannyDeclarations
11189 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11190 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11191 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11192 :
11193 : /* function exit code */
11194 0 : __Pyx_RefNannyFinishContext();
11195 0 : return __pyx_r;
11196 : }
11197 :
11198 0 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11199 0 : Py_ssize_t __pyx_r;
11200 0 : int __pyx_t_1;
11201 :
11202 : /* "View.MemoryView":611
11203 : *
11204 : * def __len__(self):
11205 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11206 : * return self.view.shape[0]
11207 : *
11208 : */
11209 0 : __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11210 0 : if (__pyx_t_1) {
11211 :
11212 : /* "View.MemoryView":612
11213 : * def __len__(self):
11214 : * if self.view.ndim >= 1:
11215 : * return self.view.shape[0] # <<<<<<<<<<<<<<
11216 : *
11217 : * return 0
11218 : */
11219 0 : __pyx_r = (__pyx_v_self->view.shape[0]);
11220 0 : goto __pyx_L0;
11221 :
11222 : /* "View.MemoryView":611
11223 : *
11224 : * def __len__(self):
11225 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11226 : * return self.view.shape[0]
11227 : *
11228 : */
11229 : }
11230 :
11231 : /* "View.MemoryView":614
11232 : * return self.view.shape[0]
11233 : *
11234 : * return 0 # <<<<<<<<<<<<<<
11235 : *
11236 : * def __repr__(self):
11237 : */
11238 0 : __pyx_r = 0;
11239 0 : goto __pyx_L0;
11240 :
11241 : /* "View.MemoryView":610
11242 : * return self._size
11243 : *
11244 : * def __len__(self): # <<<<<<<<<<<<<<
11245 : * if self.view.ndim >= 1:
11246 : * return self.view.shape[0]
11247 : */
11248 :
11249 : /* function exit code */
11250 0 : __pyx_L0:;
11251 0 : return __pyx_r;
11252 : }
11253 :
11254 : /* "View.MemoryView":616
11255 : * return 0
11256 : *
11257 : * def __repr__(self): # <<<<<<<<<<<<<<
11258 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11259 : * id(self))
11260 : */
11261 :
11262 : /* Python wrapper */
11263 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11264 0 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11265 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11266 0 : PyObject *__pyx_r = 0;
11267 : __Pyx_RefNannyDeclarations
11268 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11269 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11270 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11271 :
11272 : /* function exit code */
11273 0 : __Pyx_RefNannyFinishContext();
11274 0 : return __pyx_r;
11275 : }
11276 :
11277 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11278 0 : PyObject *__pyx_r = NULL;
11279 : __Pyx_RefNannyDeclarations
11280 0 : PyObject *__pyx_t_1 = NULL;
11281 0 : PyObject *__pyx_t_2 = NULL;
11282 0 : PyObject *__pyx_t_3 = NULL;
11283 0 : int __pyx_lineno = 0;
11284 0 : const char *__pyx_filename = NULL;
11285 0 : int __pyx_clineno = 0;
11286 0 : __Pyx_RefNannySetupContext("__repr__", 1);
11287 :
11288 : /* "View.MemoryView":617
11289 : *
11290 : * def __repr__(self):
11291 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11292 : * id(self))
11293 : *
11294 : */
11295 0 : __Pyx_XDECREF(__pyx_r);
11296 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11297 0 : __Pyx_GOTREF(__pyx_t_1);
11298 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11299 0 : __Pyx_GOTREF(__pyx_t_2);
11300 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11301 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11302 0 : __Pyx_GOTREF(__pyx_t_1);
11303 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11304 :
11305 : /* "View.MemoryView":618
11306 : * def __repr__(self):
11307 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11308 : * id(self)) # <<<<<<<<<<<<<<
11309 : *
11310 : * def __str__(self):
11311 : */
11312 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
11313 0 : __Pyx_GOTREF(__pyx_t_2);
11314 :
11315 : /* "View.MemoryView":617
11316 : *
11317 : * def __repr__(self):
11318 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11319 : * id(self))
11320 : *
11321 : */
11322 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
11323 0 : __Pyx_GOTREF(__pyx_t_3);
11324 0 : __Pyx_GIVEREF(__pyx_t_1);
11325 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error);
11326 0 : __Pyx_GIVEREF(__pyx_t_2);
11327 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error);
11328 0 : __pyx_t_1 = 0;
11329 0 : __pyx_t_2 = 0;
11330 0 : __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11331 0 : __Pyx_GOTREF(__pyx_t_2);
11332 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11333 0 : __pyx_r = __pyx_t_2;
11334 0 : __pyx_t_2 = 0;
11335 0 : goto __pyx_L0;
11336 :
11337 : /* "View.MemoryView":616
11338 : * return 0
11339 : *
11340 : * def __repr__(self): # <<<<<<<<<<<<<<
11341 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11342 : * id(self))
11343 : */
11344 :
11345 : /* function exit code */
11346 0 : __pyx_L1_error:;
11347 0 : __Pyx_XDECREF(__pyx_t_1);
11348 0 : __Pyx_XDECREF(__pyx_t_2);
11349 0 : __Pyx_XDECREF(__pyx_t_3);
11350 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11351 0 : __pyx_r = NULL;
11352 0 : __pyx_L0:;
11353 0 : __Pyx_XGIVEREF(__pyx_r);
11354 0 : __Pyx_RefNannyFinishContext();
11355 0 : return __pyx_r;
11356 : }
11357 :
11358 : /* "View.MemoryView":620
11359 : * id(self))
11360 : *
11361 : * def __str__(self): # <<<<<<<<<<<<<<
11362 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11363 : *
11364 : */
11365 :
11366 : /* Python wrapper */
11367 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11368 0 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11369 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11370 0 : PyObject *__pyx_r = 0;
11371 : __Pyx_RefNannyDeclarations
11372 0 : __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11373 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11374 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11375 :
11376 : /* function exit code */
11377 0 : __Pyx_RefNannyFinishContext();
11378 0 : return __pyx_r;
11379 : }
11380 :
11381 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11382 0 : PyObject *__pyx_r = NULL;
11383 : __Pyx_RefNannyDeclarations
11384 0 : PyObject *__pyx_t_1 = NULL;
11385 0 : PyObject *__pyx_t_2 = NULL;
11386 0 : int __pyx_lineno = 0;
11387 0 : const char *__pyx_filename = NULL;
11388 0 : int __pyx_clineno = 0;
11389 0 : __Pyx_RefNannySetupContext("__str__", 1);
11390 :
11391 : /* "View.MemoryView":621
11392 : *
11393 : * def __str__(self):
11394 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11395 : *
11396 : *
11397 : */
11398 0 : __Pyx_XDECREF(__pyx_r);
11399 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11400 0 : __Pyx_GOTREF(__pyx_t_1);
11401 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11402 0 : __Pyx_GOTREF(__pyx_t_2);
11403 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11404 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11405 0 : __Pyx_GOTREF(__pyx_t_1);
11406 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11407 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11408 0 : __Pyx_GOTREF(__pyx_t_2);
11409 0 : __Pyx_GIVEREF(__pyx_t_1);
11410 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error);
11411 0 : __pyx_t_1 = 0;
11412 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11413 0 : __Pyx_GOTREF(__pyx_t_1);
11414 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11415 0 : __pyx_r = __pyx_t_1;
11416 0 : __pyx_t_1 = 0;
11417 0 : goto __pyx_L0;
11418 :
11419 : /* "View.MemoryView":620
11420 : * id(self))
11421 : *
11422 : * def __str__(self): # <<<<<<<<<<<<<<
11423 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11424 : *
11425 : */
11426 :
11427 : /* function exit code */
11428 0 : __pyx_L1_error:;
11429 0 : __Pyx_XDECREF(__pyx_t_1);
11430 0 : __Pyx_XDECREF(__pyx_t_2);
11431 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11432 0 : __pyx_r = NULL;
11433 0 : __pyx_L0:;
11434 0 : __Pyx_XGIVEREF(__pyx_r);
11435 0 : __Pyx_RefNannyFinishContext();
11436 0 : return __pyx_r;
11437 : }
11438 :
11439 : /* "View.MemoryView":624
11440 : *
11441 : *
11442 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11443 : * cdef __Pyx_memviewslice *mslice
11444 : * cdef __Pyx_memviewslice tmp
11445 : */
11446 :
11447 : /* Python wrapper */
11448 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11449 : #if CYTHON_METH_FASTCALL
11450 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11451 : #else
11452 : PyObject *__pyx_args, PyObject *__pyx_kwds
11453 : #endif
11454 : ); /*proto*/
11455 0 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11456 : #if CYTHON_METH_FASTCALL
11457 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11458 : #else
11459 : PyObject *__pyx_args, PyObject *__pyx_kwds
11460 : #endif
11461 : ) {
11462 : #if !CYTHON_METH_FASTCALL
11463 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11464 : #endif
11465 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11466 0 : PyObject *__pyx_r = 0;
11467 : __Pyx_RefNannyDeclarations
11468 0 : __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11469 : #if !CYTHON_METH_FASTCALL
11470 : #if CYTHON_ASSUME_SAFE_MACROS
11471 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11472 : #else
11473 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11474 : #endif
11475 : #endif
11476 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11477 0 : if (unlikely(__pyx_nargs > 0)) {
11478 0 : __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11479 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
11480 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11481 :
11482 : /* function exit code */
11483 0 : __Pyx_RefNannyFinishContext();
11484 0 : return __pyx_r;
11485 : }
11486 :
11487 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11488 0 : __Pyx_memviewslice *__pyx_v_mslice;
11489 0 : __Pyx_memviewslice __pyx_v_tmp;
11490 0 : PyObject *__pyx_r = NULL;
11491 : __Pyx_RefNannyDeclarations
11492 0 : __Pyx_memviewslice *__pyx_t_1;
11493 0 : PyObject *__pyx_t_2 = NULL;
11494 0 : int __pyx_lineno = 0;
11495 0 : const char *__pyx_filename = NULL;
11496 0 : int __pyx_clineno = 0;
11497 0 : __Pyx_RefNannySetupContext("is_c_contig", 1);
11498 :
11499 : /* "View.MemoryView":627
11500 : * cdef __Pyx_memviewslice *mslice
11501 : * cdef __Pyx_memviewslice tmp
11502 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11503 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11504 : *
11505 : */
11506 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
11507 0 : __pyx_v_mslice = __pyx_t_1;
11508 :
11509 : /* "View.MemoryView":628
11510 : * cdef __Pyx_memviewslice tmp
11511 : * mslice = get_slice_from_memview(self, &tmp)
11512 : * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11513 : *
11514 : * def is_f_contig(self):
11515 : */
11516 0 : __Pyx_XDECREF(__pyx_r);
11517 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
11518 0 : __Pyx_GOTREF(__pyx_t_2);
11519 0 : __pyx_r = __pyx_t_2;
11520 0 : __pyx_t_2 = 0;
11521 0 : goto __pyx_L0;
11522 :
11523 : /* "View.MemoryView":624
11524 : *
11525 : *
11526 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11527 : * cdef __Pyx_memviewslice *mslice
11528 : * cdef __Pyx_memviewslice tmp
11529 : */
11530 :
11531 : /* function exit code */
11532 0 : __pyx_L1_error:;
11533 0 : __Pyx_XDECREF(__pyx_t_2);
11534 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11535 0 : __pyx_r = NULL;
11536 0 : __pyx_L0:;
11537 0 : __Pyx_XGIVEREF(__pyx_r);
11538 0 : __Pyx_RefNannyFinishContext();
11539 0 : return __pyx_r;
11540 : }
11541 :
11542 : /* "View.MemoryView":630
11543 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11544 : *
11545 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11546 : * cdef __Pyx_memviewslice *mslice
11547 : * cdef __Pyx_memviewslice tmp
11548 : */
11549 :
11550 : /* Python wrapper */
11551 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11552 : #if CYTHON_METH_FASTCALL
11553 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11554 : #else
11555 : PyObject *__pyx_args, PyObject *__pyx_kwds
11556 : #endif
11557 : ); /*proto*/
11558 0 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11559 : #if CYTHON_METH_FASTCALL
11560 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11561 : #else
11562 : PyObject *__pyx_args, PyObject *__pyx_kwds
11563 : #endif
11564 : ) {
11565 : #if !CYTHON_METH_FASTCALL
11566 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11567 : #endif
11568 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11569 0 : PyObject *__pyx_r = 0;
11570 : __Pyx_RefNannyDeclarations
11571 0 : __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11572 : #if !CYTHON_METH_FASTCALL
11573 : #if CYTHON_ASSUME_SAFE_MACROS
11574 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11575 : #else
11576 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11577 : #endif
11578 : #endif
11579 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11580 0 : if (unlikely(__pyx_nargs > 0)) {
11581 0 : __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11582 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
11583 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11584 :
11585 : /* function exit code */
11586 0 : __Pyx_RefNannyFinishContext();
11587 0 : return __pyx_r;
11588 : }
11589 :
11590 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11591 0 : __Pyx_memviewslice *__pyx_v_mslice;
11592 0 : __Pyx_memviewslice __pyx_v_tmp;
11593 0 : PyObject *__pyx_r = NULL;
11594 : __Pyx_RefNannyDeclarations
11595 0 : __Pyx_memviewslice *__pyx_t_1;
11596 0 : PyObject *__pyx_t_2 = NULL;
11597 0 : int __pyx_lineno = 0;
11598 0 : const char *__pyx_filename = NULL;
11599 0 : int __pyx_clineno = 0;
11600 0 : __Pyx_RefNannySetupContext("is_f_contig", 1);
11601 :
11602 : /* "View.MemoryView":633
11603 : * cdef __Pyx_memviewslice *mslice
11604 : * cdef __Pyx_memviewslice tmp
11605 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11606 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11607 : *
11608 : */
11609 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
11610 0 : __pyx_v_mslice = __pyx_t_1;
11611 :
11612 : /* "View.MemoryView":634
11613 : * cdef __Pyx_memviewslice tmp
11614 : * mslice = get_slice_from_memview(self, &tmp)
11615 : * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11616 : *
11617 : * def copy(self):
11618 : */
11619 0 : __Pyx_XDECREF(__pyx_r);
11620 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
11621 0 : __Pyx_GOTREF(__pyx_t_2);
11622 0 : __pyx_r = __pyx_t_2;
11623 0 : __pyx_t_2 = 0;
11624 0 : goto __pyx_L0;
11625 :
11626 : /* "View.MemoryView":630
11627 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11628 : *
11629 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11630 : * cdef __Pyx_memviewslice *mslice
11631 : * cdef __Pyx_memviewslice tmp
11632 : */
11633 :
11634 : /* function exit code */
11635 0 : __pyx_L1_error:;
11636 0 : __Pyx_XDECREF(__pyx_t_2);
11637 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11638 0 : __pyx_r = NULL;
11639 0 : __pyx_L0:;
11640 0 : __Pyx_XGIVEREF(__pyx_r);
11641 0 : __Pyx_RefNannyFinishContext();
11642 0 : return __pyx_r;
11643 : }
11644 :
11645 : /* "View.MemoryView":636
11646 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11647 : *
11648 : * def copy(self): # <<<<<<<<<<<<<<
11649 : * cdef __Pyx_memviewslice mslice
11650 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11651 : */
11652 :
11653 : /* Python wrapper */
11654 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11655 : #if CYTHON_METH_FASTCALL
11656 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11657 : #else
11658 : PyObject *__pyx_args, PyObject *__pyx_kwds
11659 : #endif
11660 : ); /*proto*/
11661 0 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11662 : #if CYTHON_METH_FASTCALL
11663 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11664 : #else
11665 : PyObject *__pyx_args, PyObject *__pyx_kwds
11666 : #endif
11667 : ) {
11668 : #if !CYTHON_METH_FASTCALL
11669 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11670 : #endif
11671 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11672 0 : PyObject *__pyx_r = 0;
11673 : __Pyx_RefNannyDeclarations
11674 0 : __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11675 : #if !CYTHON_METH_FASTCALL
11676 : #if CYTHON_ASSUME_SAFE_MACROS
11677 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11678 : #else
11679 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11680 : #endif
11681 : #endif
11682 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11683 0 : if (unlikely(__pyx_nargs > 0)) {
11684 0 : __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
11685 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
11686 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11687 :
11688 : /* function exit code */
11689 0 : __Pyx_RefNannyFinishContext();
11690 0 : return __pyx_r;
11691 : }
11692 :
11693 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11694 0 : __Pyx_memviewslice __pyx_v_mslice;
11695 0 : int __pyx_v_flags;
11696 0 : PyObject *__pyx_r = NULL;
11697 : __Pyx_RefNannyDeclarations
11698 0 : __Pyx_memviewslice __pyx_t_1;
11699 0 : PyObject *__pyx_t_2 = NULL;
11700 0 : int __pyx_lineno = 0;
11701 0 : const char *__pyx_filename = NULL;
11702 0 : int __pyx_clineno = 0;
11703 0 : __Pyx_RefNannySetupContext("copy", 1);
11704 :
11705 : /* "View.MemoryView":638
11706 : * def copy(self):
11707 : * cdef __Pyx_memviewslice mslice
11708 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11709 : *
11710 : * slice_copy(self, &mslice)
11711 : */
11712 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11713 :
11714 : /* "View.MemoryView":640
11715 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11716 : *
11717 : * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
11718 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11719 : * self.view.itemsize,
11720 : */
11721 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11722 :
11723 : /* "View.MemoryView":641
11724 : *
11725 : * slice_copy(self, &mslice)
11726 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
11727 : * self.view.itemsize,
11728 : * flags|PyBUF_C_CONTIGUOUS,
11729 : */
11730 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
11731 0 : __pyx_v_mslice = __pyx_t_1;
11732 :
11733 : /* "View.MemoryView":646
11734 : * self.dtype_is_object)
11735 : *
11736 : * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
11737 : *
11738 : * def copy_fortran(self):
11739 : */
11740 0 : __Pyx_XDECREF(__pyx_r);
11741 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
11742 0 : __Pyx_GOTREF(__pyx_t_2);
11743 0 : __pyx_r = __pyx_t_2;
11744 0 : __pyx_t_2 = 0;
11745 0 : goto __pyx_L0;
11746 :
11747 : /* "View.MemoryView":636
11748 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11749 : *
11750 : * def copy(self): # <<<<<<<<<<<<<<
11751 : * cdef __Pyx_memviewslice mslice
11752 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11753 : */
11754 :
11755 : /* function exit code */
11756 0 : __pyx_L1_error:;
11757 0 : __Pyx_XDECREF(__pyx_t_2);
11758 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11759 0 : __pyx_r = NULL;
11760 0 : __pyx_L0:;
11761 0 : __Pyx_XGIVEREF(__pyx_r);
11762 0 : __Pyx_RefNannyFinishContext();
11763 0 : return __pyx_r;
11764 : }
11765 :
11766 : /* "View.MemoryView":648
11767 : * return memoryview_copy_from_slice(self, &mslice)
11768 : *
11769 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11770 : * cdef __Pyx_memviewslice src, dst
11771 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11772 : */
11773 :
11774 : /* Python wrapper */
11775 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11776 : #if CYTHON_METH_FASTCALL
11777 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11778 : #else
11779 : PyObject *__pyx_args, PyObject *__pyx_kwds
11780 : #endif
11781 : ); /*proto*/
11782 0 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11783 : #if CYTHON_METH_FASTCALL
11784 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11785 : #else
11786 : PyObject *__pyx_args, PyObject *__pyx_kwds
11787 : #endif
11788 : ) {
11789 : #if !CYTHON_METH_FASTCALL
11790 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11791 : #endif
11792 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11793 0 : PyObject *__pyx_r = 0;
11794 : __Pyx_RefNannyDeclarations
11795 0 : __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
11796 : #if !CYTHON_METH_FASTCALL
11797 : #if CYTHON_ASSUME_SAFE_MACROS
11798 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11799 : #else
11800 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11801 : #endif
11802 : #endif
11803 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11804 0 : if (unlikely(__pyx_nargs > 0)) {
11805 0 : __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
11806 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
11807 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
11808 :
11809 : /* function exit code */
11810 0 : __Pyx_RefNannyFinishContext();
11811 0 : return __pyx_r;
11812 : }
11813 :
11814 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
11815 0 : __Pyx_memviewslice __pyx_v_src;
11816 0 : __Pyx_memviewslice __pyx_v_dst;
11817 0 : int __pyx_v_flags;
11818 0 : PyObject *__pyx_r = NULL;
11819 : __Pyx_RefNannyDeclarations
11820 0 : __Pyx_memviewslice __pyx_t_1;
11821 0 : PyObject *__pyx_t_2 = NULL;
11822 0 : int __pyx_lineno = 0;
11823 0 : const char *__pyx_filename = NULL;
11824 0 : int __pyx_clineno = 0;
11825 0 : __Pyx_RefNannySetupContext("copy_fortran", 1);
11826 :
11827 : /* "View.MemoryView":650
11828 : * def copy_fortran(self):
11829 : * cdef __Pyx_memviewslice src, dst
11830 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
11831 : *
11832 : * slice_copy(self, &src)
11833 : */
11834 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11835 :
11836 : /* "View.MemoryView":652
11837 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11838 : *
11839 : * slice_copy(self, &src) # <<<<<<<<<<<<<<
11840 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
11841 : * self.view.itemsize,
11842 : */
11843 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11844 :
11845 : /* "View.MemoryView":653
11846 : *
11847 : * slice_copy(self, &src)
11848 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
11849 : * self.view.itemsize,
11850 : * flags|PyBUF_F_CONTIGUOUS,
11851 : */
11852 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
11853 0 : __pyx_v_dst = __pyx_t_1;
11854 :
11855 : /* "View.MemoryView":658
11856 : * self.dtype_is_object)
11857 : *
11858 : * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
11859 : *
11860 : *
11861 : */
11862 0 : __Pyx_XDECREF(__pyx_r);
11863 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
11864 0 : __Pyx_GOTREF(__pyx_t_2);
11865 0 : __pyx_r = __pyx_t_2;
11866 0 : __pyx_t_2 = 0;
11867 0 : goto __pyx_L0;
11868 :
11869 : /* "View.MemoryView":648
11870 : * return memoryview_copy_from_slice(self, &mslice)
11871 : *
11872 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11873 : * cdef __Pyx_memviewslice src, dst
11874 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11875 : */
11876 :
11877 : /* function exit code */
11878 0 : __pyx_L1_error:;
11879 0 : __Pyx_XDECREF(__pyx_t_2);
11880 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11881 0 : __pyx_r = NULL;
11882 0 : __pyx_L0:;
11883 0 : __Pyx_XGIVEREF(__pyx_r);
11884 0 : __Pyx_RefNannyFinishContext();
11885 0 : return __pyx_r;
11886 : }
11887 :
11888 : /* "(tree fragment)":1
11889 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11890 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11891 : * def __setstate_cython__(self, __pyx_state):
11892 : */
11893 :
11894 : /* Python wrapper */
11895 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11896 : #if CYTHON_METH_FASTCALL
11897 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11898 : #else
11899 : PyObject *__pyx_args, PyObject *__pyx_kwds
11900 : #endif
11901 : ); /*proto*/
11902 0 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11903 : #if CYTHON_METH_FASTCALL
11904 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11905 : #else
11906 : PyObject *__pyx_args, PyObject *__pyx_kwds
11907 : #endif
11908 : ) {
11909 : #if !CYTHON_METH_FASTCALL
11910 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11911 : #endif
11912 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11913 0 : PyObject *__pyx_r = 0;
11914 : __Pyx_RefNannyDeclarations
11915 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11916 : #if !CYTHON_METH_FASTCALL
11917 : #if CYTHON_ASSUME_SAFE_MACROS
11918 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11919 : #else
11920 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11921 : #endif
11922 : #endif
11923 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11924 0 : if (unlikely(__pyx_nargs > 0)) {
11925 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
11926 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
11927 0 : __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11928 :
11929 : /* function exit code */
11930 0 : __Pyx_RefNannyFinishContext();
11931 0 : return __pyx_r;
11932 : }
11933 :
11934 0 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
11935 0 : PyObject *__pyx_r = NULL;
11936 : __Pyx_RefNannyDeclarations
11937 0 : int __pyx_lineno = 0;
11938 0 : const char *__pyx_filename = NULL;
11939 0 : int __pyx_clineno = 0;
11940 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
11941 :
11942 : /* "(tree fragment)":2
11943 : * def __reduce_cython__(self):
11944 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
11945 : * def __setstate_cython__(self, __pyx_state):
11946 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11947 : */
11948 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
11949 0 : __PYX_ERR(1, 2, __pyx_L1_error)
11950 :
11951 : /* "(tree fragment)":1
11952 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11953 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11954 : * def __setstate_cython__(self, __pyx_state):
11955 : */
11956 :
11957 : /* function exit code */
11958 0 : __pyx_L1_error:;
11959 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11960 0 : __pyx_r = NULL;
11961 0 : __Pyx_XGIVEREF(__pyx_r);
11962 0 : __Pyx_RefNannyFinishContext();
11963 0 : return __pyx_r;
11964 : }
11965 :
11966 : /* "(tree fragment)":3
11967 : * def __reduce_cython__(self):
11968 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11969 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11970 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11971 : */
11972 :
11973 : /* Python wrapper */
11974 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11975 : #if CYTHON_METH_FASTCALL
11976 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11977 : #else
11978 : PyObject *__pyx_args, PyObject *__pyx_kwds
11979 : #endif
11980 : ); /*proto*/
11981 0 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11982 : #if CYTHON_METH_FASTCALL
11983 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11984 : #else
11985 : PyObject *__pyx_args, PyObject *__pyx_kwds
11986 : #endif
11987 : ) {
11988 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
11989 : #if !CYTHON_METH_FASTCALL
11990 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11991 : #endif
11992 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11993 0 : PyObject* values[1] = {0};
11994 0 : int __pyx_lineno = 0;
11995 0 : const char *__pyx_filename = NULL;
11996 0 : int __pyx_clineno = 0;
11997 0 : PyObject *__pyx_r = 0;
11998 : __Pyx_RefNannyDeclarations
11999 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12000 : #if !CYTHON_METH_FASTCALL
12001 : #if CYTHON_ASSUME_SAFE_MACROS
12002 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12003 : #else
12004 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12005 : #endif
12006 : #endif
12007 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12008 : {
12009 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
12010 0 : if (__pyx_kwds) {
12011 0 : Py_ssize_t kw_args;
12012 0 : switch (__pyx_nargs) {
12013 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12014 0 : CYTHON_FALLTHROUGH;
12015 0 : case 0: break;
12016 0 : default: goto __pyx_L5_argtuple_error;
12017 : }
12018 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
12019 0 : switch (__pyx_nargs) {
12020 : case 0:
12021 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
12022 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
12023 0 : kw_args--;
12024 : }
12025 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
12026 0 : else goto __pyx_L5_argtuple_error;
12027 : }
12028 0 : if (unlikely(kw_args > 0)) {
12029 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
12030 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12031 : }
12032 0 : } else if (unlikely(__pyx_nargs != 1)) {
12033 0 : goto __pyx_L5_argtuple_error;
12034 : } else {
12035 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12036 : }
12037 0 : __pyx_v___pyx_state = values[0];
12038 : }
12039 0 : goto __pyx_L6_skip;
12040 0 : __pyx_L5_argtuple_error:;
12041 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12042 0 : __pyx_L6_skip:;
12043 0 : goto __pyx_L4_argument_unpacking_done;
12044 0 : __pyx_L3_error:;
12045 : {
12046 0 : Py_ssize_t __pyx_temp;
12047 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12048 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12049 : }
12050 : }
12051 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12052 0 : __Pyx_RefNannyFinishContext();
12053 0 : return NULL;
12054 0 : __pyx_L4_argument_unpacking_done:;
12055 0 : __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12056 :
12057 : /* function exit code */
12058 : {
12059 0 : Py_ssize_t __pyx_temp;
12060 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12061 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12062 : }
12063 : }
12064 : __Pyx_RefNannyFinishContext();
12065 : return __pyx_r;
12066 : }
12067 :
12068 0 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12069 0 : PyObject *__pyx_r = NULL;
12070 : __Pyx_RefNannyDeclarations
12071 0 : int __pyx_lineno = 0;
12072 0 : const char *__pyx_filename = NULL;
12073 0 : int __pyx_clineno = 0;
12074 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
12075 :
12076 : /* "(tree fragment)":4
12077 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12078 : * def __setstate_cython__(self, __pyx_state):
12079 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12080 : */
12081 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
12082 0 : __PYX_ERR(1, 4, __pyx_L1_error)
12083 :
12084 : /* "(tree fragment)":3
12085 : * def __reduce_cython__(self):
12086 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12087 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12088 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12089 : */
12090 :
12091 : /* function exit code */
12092 0 : __pyx_L1_error:;
12093 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12094 0 : __pyx_r = NULL;
12095 0 : __Pyx_XGIVEREF(__pyx_r);
12096 0 : __Pyx_RefNannyFinishContext();
12097 0 : return __pyx_r;
12098 : }
12099 :
12100 : /* "View.MemoryView":662
12101 : *
12102 : * @cname('__pyx_memoryview_new')
12103 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12104 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12105 : * result.typeinfo = typeinfo
12106 : */
12107 :
12108 314 : static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12109 314 : struct __pyx_memoryview_obj *__pyx_v_result = 0;
12110 314 : PyObject *__pyx_r = NULL;
12111 : __Pyx_RefNannyDeclarations
12112 314 : PyObject *__pyx_t_1 = NULL;
12113 314 : PyObject *__pyx_t_2 = NULL;
12114 314 : PyObject *__pyx_t_3 = NULL;
12115 314 : int __pyx_lineno = 0;
12116 314 : const char *__pyx_filename = NULL;
12117 314 : int __pyx_clineno = 0;
12118 314 : __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);
12119 :
12120 : /* "View.MemoryView":663
12121 : * @cname('__pyx_memoryview_new')
12122 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12123 : * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12124 : * result.typeinfo = typeinfo
12125 : * return result
12126 : */
12127 314 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
12128 314 : __Pyx_GOTREF(__pyx_t_1);
12129 314 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12130 314 : __Pyx_GOTREF(__pyx_t_2);
12131 314 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
12132 314 : __Pyx_GOTREF(__pyx_t_3);
12133 314 : __Pyx_INCREF(__pyx_v_o);
12134 314 : __Pyx_GIVEREF(__pyx_v_o);
12135 314 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(1, 663, __pyx_L1_error);
12136 314 : __Pyx_GIVEREF(__pyx_t_1);
12137 314 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error);
12138 314 : __Pyx_GIVEREF(__pyx_t_2);
12139 314 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error);
12140 314 : __pyx_t_1 = 0;
12141 314 : __pyx_t_2 = 0;
12142 314 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12143 314 : __Pyx_GOTREF(__pyx_t_2);
12144 314 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12145 314 : __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12146 314 : __pyx_t_2 = 0;
12147 :
12148 : /* "View.MemoryView":664
12149 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12150 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12151 : * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12152 : * return result
12153 : *
12154 : */
12155 314 : __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12156 :
12157 : /* "View.MemoryView":665
12158 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12159 : * result.typeinfo = typeinfo
12160 : * return result # <<<<<<<<<<<<<<
12161 : *
12162 : * @cname('__pyx_memoryview_check')
12163 : */
12164 314 : __Pyx_XDECREF(__pyx_r);
12165 314 : __Pyx_INCREF((PyObject *)__pyx_v_result);
12166 314 : __pyx_r = ((PyObject *)__pyx_v_result);
12167 314 : goto __pyx_L0;
12168 :
12169 : /* "View.MemoryView":662
12170 : *
12171 : * @cname('__pyx_memoryview_new')
12172 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12173 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12174 : * result.typeinfo = typeinfo
12175 : */
12176 :
12177 : /* function exit code */
12178 0 : __pyx_L1_error:;
12179 0 : __Pyx_XDECREF(__pyx_t_1);
12180 0 : __Pyx_XDECREF(__pyx_t_2);
12181 0 : __Pyx_XDECREF(__pyx_t_3);
12182 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12183 0 : __pyx_r = 0;
12184 314 : __pyx_L0:;
12185 314 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
12186 314 : __Pyx_XGIVEREF(__pyx_r);
12187 314 : __Pyx_RefNannyFinishContext();
12188 314 : return __pyx_r;
12189 : }
12190 :
12191 : /* "View.MemoryView":668
12192 : *
12193 : * @cname('__pyx_memoryview_check')
12194 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12195 : * return isinstance(o, memoryview)
12196 : *
12197 : */
12198 :
12199 322 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12200 322 : int __pyx_r;
12201 322 : int __pyx_t_1;
12202 :
12203 : /* "View.MemoryView":669
12204 : * @cname('__pyx_memoryview_check')
12205 : * cdef inline bint memoryview_check(object o) noexcept:
12206 : * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12207 : *
12208 : * cdef tuple _unellipsify(object index, int ndim):
12209 : */
12210 322 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12211 322 : __pyx_r = __pyx_t_1;
12212 322 : goto __pyx_L0;
12213 :
12214 : /* "View.MemoryView":668
12215 : *
12216 : * @cname('__pyx_memoryview_check')
12217 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12218 : * return isinstance(o, memoryview)
12219 : *
12220 : */
12221 :
12222 : /* function exit code */
12223 322 : __pyx_L0:;
12224 322 : return __pyx_r;
12225 : }
12226 :
12227 : /* "View.MemoryView":671
12228 : * return isinstance(o, memoryview)
12229 : *
12230 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12231 : * """
12232 : * Replace all ellipses with full slices and fill incomplete indices with
12233 : */
12234 :
12235 0 : static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12236 0 : Py_ssize_t __pyx_v_idx;
12237 0 : PyObject *__pyx_v_tup = NULL;
12238 0 : PyObject *__pyx_v_result = NULL;
12239 0 : int __pyx_v_have_slices;
12240 0 : int __pyx_v_seen_ellipsis;
12241 0 : PyObject *__pyx_v_item = NULL;
12242 0 : Py_ssize_t __pyx_v_nslices;
12243 0 : PyObject *__pyx_r = NULL;
12244 : __Pyx_RefNannyDeclarations
12245 0 : PyObject *__pyx_t_1 = NULL;
12246 0 : int __pyx_t_2;
12247 0 : PyObject *__pyx_t_3 = NULL;
12248 0 : Py_ssize_t __pyx_t_4;
12249 0 : Py_ssize_t __pyx_t_5;
12250 0 : Py_UCS4 __pyx_t_6;
12251 0 : PyObject *__pyx_t_7 = NULL;
12252 0 : int __pyx_lineno = 0;
12253 0 : const char *__pyx_filename = NULL;
12254 0 : int __pyx_clineno = 0;
12255 0 : __Pyx_RefNannySetupContext("_unellipsify", 1);
12256 :
12257 : /* "View.MemoryView":677
12258 : * """
12259 : * cdef Py_ssize_t idx
12260 : * tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
12261 : *
12262 : * result = [slice(None)] * ndim
12263 : */
12264 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_index);
12265 0 : if (__pyx_t_2) {
12266 0 : __Pyx_INCREF(((PyObject*)__pyx_v_index));
12267 : __pyx_t_1 = __pyx_v_index;
12268 : } else {
12269 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
12270 0 : __Pyx_GOTREF(__pyx_t_3);
12271 0 : __Pyx_INCREF(__pyx_v_index);
12272 0 : __Pyx_GIVEREF(__pyx_v_index);
12273 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(1, 677, __pyx_L1_error);
12274 0 : __pyx_t_1 = __pyx_t_3;
12275 0 : __pyx_t_3 = 0;
12276 : }
12277 0 : __pyx_v_tup = ((PyObject*)__pyx_t_1);
12278 0 : __pyx_t_1 = 0;
12279 :
12280 : /* "View.MemoryView":679
12281 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
12282 : *
12283 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12284 : * have_slices = False
12285 : * seen_ellipsis = False
12286 : */
12287 0 : __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
12288 : __Pyx_GOTREF(__pyx_t_1);
12289 : { Py_ssize_t __pyx_temp;
12290 0 : for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12291 0 : __Pyx_INCREF(__pyx_slice__5);
12292 0 : __Pyx_GIVEREF(__pyx_slice__5);
12293 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error);
12294 : }
12295 : }
12296 0 : __pyx_v_result = ((PyObject*)__pyx_t_1);
12297 0 : __pyx_t_1 = 0;
12298 :
12299 : /* "View.MemoryView":680
12300 : *
12301 : * result = [slice(None)] * ndim
12302 : * have_slices = False # <<<<<<<<<<<<<<
12303 : * seen_ellipsis = False
12304 : * idx = 0
12305 : */
12306 0 : __pyx_v_have_slices = 0;
12307 :
12308 : /* "View.MemoryView":681
12309 : * result = [slice(None)] * ndim
12310 : * have_slices = False
12311 : * seen_ellipsis = False # <<<<<<<<<<<<<<
12312 : * idx = 0
12313 : * for item in tup:
12314 : */
12315 0 : __pyx_v_seen_ellipsis = 0;
12316 :
12317 : /* "View.MemoryView":682
12318 : * have_slices = False
12319 : * seen_ellipsis = False
12320 : * idx = 0 # <<<<<<<<<<<<<<
12321 : * for item in tup:
12322 : * if item is Ellipsis:
12323 : */
12324 0 : __pyx_v_idx = 0;
12325 :
12326 : /* "View.MemoryView":683
12327 : * seen_ellipsis = False
12328 : * idx = 0
12329 : * for item in tup: # <<<<<<<<<<<<<<
12330 : * if item is Ellipsis:
12331 : * if not seen_ellipsis:
12332 : */
12333 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12334 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
12335 0 : __PYX_ERR(1, 683, __pyx_L1_error)
12336 : }
12337 0 : __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
12338 : __pyx_t_4 = 0;
12339 0 : for (;;) {
12340 0 : {
12341 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12342 : #if !CYTHON_ASSUME_SAFE_MACROS
12343 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12344 : #endif
12345 0 : if (__pyx_t_4 >= __pyx_temp) break;
12346 : }
12347 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12348 0 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12349 : #else
12350 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
12351 : __Pyx_GOTREF(__pyx_t_3);
12352 : #endif
12353 0 : __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12354 0 : __pyx_t_3 = 0;
12355 :
12356 : /* "View.MemoryView":684
12357 : * idx = 0
12358 : * for item in tup:
12359 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12360 : * if not seen_ellipsis:
12361 : * idx += ndim - len(tup)
12362 : */
12363 0 : __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12364 0 : if (__pyx_t_2) {
12365 :
12366 : /* "View.MemoryView":685
12367 : * for item in tup:
12368 : * if item is Ellipsis:
12369 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12370 : * idx += ndim - len(tup)
12371 : * seen_ellipsis = True
12372 : */
12373 0 : __pyx_t_2 = (!__pyx_v_seen_ellipsis);
12374 0 : if (__pyx_t_2) {
12375 :
12376 : /* "View.MemoryView":686
12377 : * if item is Ellipsis:
12378 : * if not seen_ellipsis:
12379 : * idx += ndim - len(tup) # <<<<<<<<<<<<<<
12380 : * seen_ellipsis = True
12381 : * have_slices = True
12382 : */
12383 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12384 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
12385 : __PYX_ERR(1, 686, __pyx_L1_error)
12386 : }
12387 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
12388 0 : __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
12389 :
12390 : /* "View.MemoryView":687
12391 : * if not seen_ellipsis:
12392 : * idx += ndim - len(tup)
12393 : * seen_ellipsis = True # <<<<<<<<<<<<<<
12394 : * have_slices = True
12395 : * else:
12396 : */
12397 0 : __pyx_v_seen_ellipsis = 1;
12398 :
12399 : /* "View.MemoryView":685
12400 : * for item in tup:
12401 : * if item is Ellipsis:
12402 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12403 : * idx += ndim - len(tup)
12404 : * seen_ellipsis = True
12405 : */
12406 : }
12407 :
12408 : /* "View.MemoryView":688
12409 : * idx += ndim - len(tup)
12410 : * seen_ellipsis = True
12411 : * have_slices = True # <<<<<<<<<<<<<<
12412 : * else:
12413 : * if isinstance(item, slice):
12414 : */
12415 0 : __pyx_v_have_slices = 1;
12416 :
12417 : /* "View.MemoryView":684
12418 : * idx = 0
12419 : * for item in tup:
12420 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12421 : * if not seen_ellipsis:
12422 : * idx += ndim - len(tup)
12423 : */
12424 0 : goto __pyx_L5;
12425 : }
12426 :
12427 : /* "View.MemoryView":690
12428 : * have_slices = True
12429 : * else:
12430 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12431 : * have_slices = True
12432 : * elif not PyIndex_Check(item):
12433 : */
12434 : /*else*/ {
12435 0 : __pyx_t_2 = PySlice_Check(__pyx_v_item);
12436 0 : if (__pyx_t_2) {
12437 :
12438 : /* "View.MemoryView":691
12439 : * else:
12440 : * if isinstance(item, slice):
12441 : * have_slices = True # <<<<<<<<<<<<<<
12442 : * elif not PyIndex_Check(item):
12443 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12444 : */
12445 0 : __pyx_v_have_slices = 1;
12446 :
12447 : /* "View.MemoryView":690
12448 : * have_slices = True
12449 : * else:
12450 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12451 : * have_slices = True
12452 : * elif not PyIndex_Check(item):
12453 : */
12454 0 : goto __pyx_L7;
12455 : }
12456 :
12457 : /* "View.MemoryView":692
12458 : * if isinstance(item, slice):
12459 : * have_slices = True
12460 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12461 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12462 : * result[idx] = item
12463 : */
12464 0 : __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
12465 0 : if (unlikely(__pyx_t_2)) {
12466 :
12467 : /* "View.MemoryView":693
12468 : * have_slices = True
12469 : * elif not PyIndex_Check(item):
12470 : * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
12471 : * result[idx] = item
12472 : * idx += 1
12473 : */
12474 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
12475 0 : __Pyx_GOTREF(__pyx_t_3);
12476 0 : __pyx_t_5 = 0;
12477 0 : __pyx_t_6 = 127;
12478 0 : __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
12479 0 : __pyx_t_5 += 24;
12480 0 : __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
12481 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
12482 0 : __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12483 0 : __Pyx_GOTREF(__pyx_t_7);
12484 0 : __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
12485 0 : __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
12486 0 : __Pyx_GIVEREF(__pyx_t_7);
12487 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
12488 0 : __pyx_t_7 = 0;
12489 0 : __Pyx_INCREF(__pyx_kp_u__6);
12490 0 : __pyx_t_5 += 1;
12491 0 : __Pyx_GIVEREF(__pyx_kp_u__6);
12492 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
12493 0 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12494 0 : __Pyx_GOTREF(__pyx_t_7);
12495 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12496 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
12497 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12498 0 : __PYX_ERR(1, 693, __pyx_L1_error)
12499 :
12500 : /* "View.MemoryView":692
12501 : * if isinstance(item, slice):
12502 : * have_slices = True
12503 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12504 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12505 : * result[idx] = item
12506 : */
12507 : }
12508 0 : __pyx_L7:;
12509 :
12510 : /* "View.MemoryView":694
12511 : * elif not PyIndex_Check(item):
12512 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12513 : * result[idx] = item # <<<<<<<<<<<<<<
12514 : * idx += 1
12515 : *
12516 : */
12517 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
12518 : }
12519 0 : __pyx_L5:;
12520 :
12521 : /* "View.MemoryView":695
12522 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12523 : * result[idx] = item
12524 : * idx += 1 # <<<<<<<<<<<<<<
12525 : *
12526 : * nslices = ndim - idx
12527 : */
12528 0 : __pyx_v_idx = (__pyx_v_idx + 1);
12529 :
12530 : /* "View.MemoryView":683
12531 : * seen_ellipsis = False
12532 : * idx = 0
12533 : * for item in tup: # <<<<<<<<<<<<<<
12534 : * if item is Ellipsis:
12535 : * if not seen_ellipsis:
12536 : */
12537 : }
12538 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12539 :
12540 : /* "View.MemoryView":697
12541 : * idx += 1
12542 : *
12543 : * nslices = ndim - idx # <<<<<<<<<<<<<<
12544 : * return have_slices or nslices, tuple(result)
12545 : *
12546 : */
12547 0 : __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
12548 :
12549 : /* "View.MemoryView":698
12550 : *
12551 : * nslices = ndim - idx
12552 : * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
12553 : *
12554 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12555 : */
12556 0 : __Pyx_XDECREF(__pyx_r);
12557 0 : if (!__pyx_v_have_slices) {
12558 0 : } else {
12559 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12560 0 : __Pyx_GOTREF(__pyx_t_7);
12561 0 : __pyx_t_1 = __pyx_t_7;
12562 0 : __pyx_t_7 = 0;
12563 0 : goto __pyx_L9_bool_binop_done;
12564 : }
12565 0 : __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12566 : __Pyx_GOTREF(__pyx_t_7);
12567 : __pyx_t_1 = __pyx_t_7;
12568 0 : __pyx_t_7 = 0;
12569 0 : __pyx_L9_bool_binop_done:;
12570 0 : __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12571 0 : __Pyx_GOTREF(__pyx_t_7);
12572 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
12573 0 : __Pyx_GOTREF(__pyx_t_3);
12574 0 : __Pyx_GIVEREF(__pyx_t_1);
12575 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 698, __pyx_L1_error);
12576 0 : __Pyx_GIVEREF(__pyx_t_7);
12577 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error);
12578 0 : __pyx_t_1 = 0;
12579 0 : __pyx_t_7 = 0;
12580 0 : __pyx_r = ((PyObject*)__pyx_t_3);
12581 0 : __pyx_t_3 = 0;
12582 0 : goto __pyx_L0;
12583 :
12584 : /* "View.MemoryView":671
12585 : * return isinstance(o, memoryview)
12586 : *
12587 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12588 : * """
12589 : * Replace all ellipses with full slices and fill incomplete indices with
12590 : */
12591 :
12592 : /* function exit code */
12593 0 : __pyx_L1_error:;
12594 0 : __Pyx_XDECREF(__pyx_t_1);
12595 0 : __Pyx_XDECREF(__pyx_t_3);
12596 0 : __Pyx_XDECREF(__pyx_t_7);
12597 0 : __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
12598 0 : __pyx_r = 0;
12599 0 : __pyx_L0:;
12600 0 : __Pyx_XDECREF(__pyx_v_tup);
12601 0 : __Pyx_XDECREF(__pyx_v_result);
12602 0 : __Pyx_XDECREF(__pyx_v_item);
12603 0 : __Pyx_XGIVEREF(__pyx_r);
12604 0 : __Pyx_RefNannyFinishContext();
12605 0 : return __pyx_r;
12606 : }
12607 :
12608 : /* "View.MemoryView":700
12609 : * return have_slices or nslices, tuple(result)
12610 : *
12611 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12612 : * for suboffset in suboffsets[:ndim]:
12613 : * if suboffset >= 0:
12614 : */
12615 :
12616 0 : static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
12617 0 : Py_ssize_t __pyx_v_suboffset;
12618 0 : int __pyx_r;
12619 0 : Py_ssize_t *__pyx_t_1;
12620 0 : Py_ssize_t *__pyx_t_2;
12621 0 : Py_ssize_t *__pyx_t_3;
12622 0 : int __pyx_t_4;
12623 0 : int __pyx_lineno = 0;
12624 0 : const char *__pyx_filename = NULL;
12625 0 : int __pyx_clineno = 0;
12626 :
12627 : /* "View.MemoryView":701
12628 : *
12629 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12630 : * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
12631 : * if suboffset >= 0:
12632 : * raise ValueError, "Indirect dimensions not supported"
12633 : */
12634 0 : __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
12635 0 : for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
12636 0 : __pyx_t_1 = __pyx_t_3;
12637 0 : __pyx_v_suboffset = (__pyx_t_1[0]);
12638 :
12639 : /* "View.MemoryView":702
12640 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12641 : * for suboffset in suboffsets[:ndim]:
12642 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12643 : * raise ValueError, "Indirect dimensions not supported"
12644 : * return 0 # return type just used as an error flag
12645 : */
12646 0 : __pyx_t_4 = (__pyx_v_suboffset >= 0);
12647 0 : if (unlikely(__pyx_t_4)) {
12648 :
12649 : /* "View.MemoryView":703
12650 : * for suboffset in suboffsets[:ndim]:
12651 : * if suboffset >= 0:
12652 : * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
12653 : * return 0 # return type just used as an error flag
12654 : *
12655 : */
12656 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
12657 0 : __PYX_ERR(1, 703, __pyx_L1_error)
12658 :
12659 : /* "View.MemoryView":702
12660 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12661 : * for suboffset in suboffsets[:ndim]:
12662 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12663 : * raise ValueError, "Indirect dimensions not supported"
12664 : * return 0 # return type just used as an error flag
12665 : */
12666 : }
12667 : }
12668 :
12669 : /* "View.MemoryView":704
12670 : * if suboffset >= 0:
12671 : * raise ValueError, "Indirect dimensions not supported"
12672 : * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
12673 : *
12674 : *
12675 : */
12676 0 : __pyx_r = 0;
12677 0 : goto __pyx_L0;
12678 :
12679 : /* "View.MemoryView":700
12680 : * return have_slices or nslices, tuple(result)
12681 : *
12682 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12683 : * for suboffset in suboffsets[:ndim]:
12684 : * if suboffset >= 0:
12685 : */
12686 :
12687 : /* function exit code */
12688 0 : __pyx_L1_error:;
12689 0 : __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
12690 0 : __pyx_r = -1;
12691 0 : __pyx_L0:;
12692 0 : return __pyx_r;
12693 : }
12694 :
12695 : /* "View.MemoryView":711
12696 : *
12697 : * @cname('__pyx_memview_slice')
12698 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
12699 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
12700 : * cdef bint negative_step
12701 : */
12702 :
12703 0 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
12704 0 : int __pyx_v_new_ndim;
12705 0 : int __pyx_v_suboffset_dim;
12706 0 : int __pyx_v_dim;
12707 0 : __Pyx_memviewslice __pyx_v_src;
12708 0 : __Pyx_memviewslice __pyx_v_dst;
12709 0 : __Pyx_memviewslice *__pyx_v_p_src;
12710 0 : struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
12711 0 : __Pyx_memviewslice *__pyx_v_p_dst;
12712 0 : int *__pyx_v_p_suboffset_dim;
12713 0 : Py_ssize_t __pyx_v_start;
12714 0 : Py_ssize_t __pyx_v_stop;
12715 0 : Py_ssize_t __pyx_v_step;
12716 0 : Py_ssize_t __pyx_v_cindex;
12717 0 : int __pyx_v_have_start;
12718 0 : int __pyx_v_have_stop;
12719 0 : int __pyx_v_have_step;
12720 0 : PyObject *__pyx_v_index = NULL;
12721 0 : struct __pyx_memoryview_obj *__pyx_r = NULL;
12722 : __Pyx_RefNannyDeclarations
12723 0 : int __pyx_t_1;
12724 0 : PyObject *__pyx_t_2 = NULL;
12725 0 : struct __pyx_memoryview_obj *__pyx_t_3;
12726 0 : char *__pyx_t_4;
12727 0 : int __pyx_t_5;
12728 0 : Py_ssize_t __pyx_t_6;
12729 0 : PyObject *(*__pyx_t_7)(PyObject *);
12730 0 : PyObject *__pyx_t_8 = NULL;
12731 0 : Py_ssize_t __pyx_t_9;
12732 0 : int __pyx_t_10;
12733 0 : Py_ssize_t __pyx_t_11;
12734 0 : int __pyx_lineno = 0;
12735 0 : const char *__pyx_filename = NULL;
12736 0 : int __pyx_clineno = 0;
12737 0 : __Pyx_RefNannySetupContext("memview_slice", 1);
12738 :
12739 : /* "View.MemoryView":712
12740 : * @cname('__pyx_memview_slice')
12741 : * cdef memoryview memview_slice(memoryview memview, object indices):
12742 : * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
12743 : * cdef bint negative_step
12744 : * cdef __Pyx_memviewslice src, dst
12745 : */
12746 0 : __pyx_v_new_ndim = 0;
12747 0 : __pyx_v_suboffset_dim = -1;
12748 :
12749 : /* "View.MemoryView":719
12750 : *
12751 : *
12752 : * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
12753 : *
12754 : * cdef _memoryviewslice memviewsliceobj
12755 : */
12756 0 : (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
12757 :
12758 : /* "View.MemoryView":723
12759 : * cdef _memoryviewslice memviewsliceobj
12760 : *
12761 : * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
12762 : *
12763 : * if isinstance(memview, _memoryviewslice):
12764 : */
12765 : #ifndef CYTHON_WITHOUT_ASSERTIONS
12766 0 : if (unlikely(__pyx_assertions_enabled())) {
12767 0 : __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
12768 0 : if (unlikely(!__pyx_t_1)) {
12769 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
12770 0 : __PYX_ERR(1, 723, __pyx_L1_error)
12771 : }
12772 : }
12773 : #else
12774 : if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
12775 : #endif
12776 :
12777 : /* "View.MemoryView":725
12778 : * assert memview.view.ndim > 0
12779 : *
12780 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12781 : * memviewsliceobj = memview
12782 : * p_src = &memviewsliceobj.from_slice
12783 : */
12784 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12785 0 : if (__pyx_t_1) {
12786 :
12787 : /* "View.MemoryView":726
12788 : *
12789 : * if isinstance(memview, _memoryviewslice):
12790 : * memviewsliceobj = memview # <<<<<<<<<<<<<<
12791 : * p_src = &memviewsliceobj.from_slice
12792 : * else:
12793 : */
12794 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
12795 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
12796 0 : __Pyx_INCREF(__pyx_t_2);
12797 0 : __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
12798 0 : __pyx_t_2 = 0;
12799 :
12800 : /* "View.MemoryView":727
12801 : * if isinstance(memview, _memoryviewslice):
12802 : * memviewsliceobj = memview
12803 : * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
12804 : * else:
12805 : * slice_copy(memview, &src)
12806 : */
12807 0 : __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
12808 :
12809 : /* "View.MemoryView":725
12810 : * assert memview.view.ndim > 0
12811 : *
12812 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12813 : * memviewsliceobj = memview
12814 : * p_src = &memviewsliceobj.from_slice
12815 : */
12816 0 : goto __pyx_L3;
12817 : }
12818 :
12819 : /* "View.MemoryView":729
12820 : * p_src = &memviewsliceobj.from_slice
12821 : * else:
12822 : * slice_copy(memview, &src) # <<<<<<<<<<<<<<
12823 : * p_src = &src
12824 : *
12825 : */
12826 : /*else*/ {
12827 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
12828 :
12829 : /* "View.MemoryView":730
12830 : * else:
12831 : * slice_copy(memview, &src)
12832 : * p_src = &src # <<<<<<<<<<<<<<
12833 : *
12834 : *
12835 : */
12836 0 : __pyx_v_p_src = (&__pyx_v_src);
12837 : }
12838 0 : __pyx_L3:;
12839 :
12840 : /* "View.MemoryView":736
12841 : *
12842 : *
12843 : * dst.memview = p_src.memview # <<<<<<<<<<<<<<
12844 : * dst.data = p_src.data
12845 : *
12846 : */
12847 0 : __pyx_t_3 = __pyx_v_p_src->memview;
12848 0 : __pyx_v_dst.memview = __pyx_t_3;
12849 :
12850 : /* "View.MemoryView":737
12851 : *
12852 : * dst.memview = p_src.memview
12853 : * dst.data = p_src.data # <<<<<<<<<<<<<<
12854 : *
12855 : *
12856 : */
12857 0 : __pyx_t_4 = __pyx_v_p_src->data;
12858 0 : __pyx_v_dst.data = __pyx_t_4;
12859 :
12860 : /* "View.MemoryView":742
12861 : *
12862 : *
12863 : * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
12864 : * cdef int *p_suboffset_dim = &suboffset_dim
12865 : * cdef Py_ssize_t start, stop, step, cindex
12866 : */
12867 0 : __pyx_v_p_dst = (&__pyx_v_dst);
12868 :
12869 : /* "View.MemoryView":743
12870 : *
12871 : * cdef __Pyx_memviewslice *p_dst = &dst
12872 : * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
12873 : * cdef Py_ssize_t start, stop, step, cindex
12874 : * cdef bint have_start, have_stop, have_step
12875 : */
12876 0 : __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
12877 :
12878 : /* "View.MemoryView":747
12879 : * cdef bint have_start, have_stop, have_step
12880 : *
12881 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12882 : * if PyIndex_Check(index):
12883 : * cindex = index
12884 : */
12885 0 : __pyx_t_5 = 0;
12886 0 : if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
12887 0 : __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
12888 0 : __pyx_t_6 = 0;
12889 0 : __pyx_t_7 = NULL;
12890 : } else {
12891 0 : __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
12892 0 : __Pyx_GOTREF(__pyx_t_2);
12893 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
12894 : }
12895 0 : for (;;) {
12896 0 : if (likely(!__pyx_t_7)) {
12897 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
12898 : {
12899 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
12900 : #if !CYTHON_ASSUME_SAFE_MACROS
12901 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12902 : #endif
12903 0 : if (__pyx_t_6 >= __pyx_temp) break;
12904 : }
12905 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12906 0 : __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12907 : #else
12908 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12909 : __Pyx_GOTREF(__pyx_t_8);
12910 : #endif
12911 : } else {
12912 : {
12913 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
12914 : #if !CYTHON_ASSUME_SAFE_MACROS
12915 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12916 : #endif
12917 0 : if (__pyx_t_6 >= __pyx_temp) break;
12918 : }
12919 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12920 0 : __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12921 : #else
12922 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12923 : __Pyx_GOTREF(__pyx_t_8);
12924 : #endif
12925 : }
12926 : } else {
12927 0 : __pyx_t_8 = __pyx_t_7(__pyx_t_2);
12928 0 : if (unlikely(!__pyx_t_8)) {
12929 0 : PyObject* exc_type = PyErr_Occurred();
12930 0 : if (exc_type) {
12931 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12932 0 : else __PYX_ERR(1, 747, __pyx_L1_error)
12933 : }
12934 : break;
12935 : }
12936 0 : __Pyx_GOTREF(__pyx_t_8);
12937 : }
12938 0 : __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
12939 0 : __pyx_t_8 = 0;
12940 0 : __pyx_v_dim = __pyx_t_5;
12941 0 : __pyx_t_5 = (__pyx_t_5 + 1);
12942 :
12943 : /* "View.MemoryView":748
12944 : *
12945 : * for dim, index in enumerate(indices):
12946 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12947 : * cindex = index
12948 : * slice_memviewslice(
12949 : */
12950 0 : __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
12951 0 : if (__pyx_t_1) {
12952 :
12953 : /* "View.MemoryView":749
12954 : * for dim, index in enumerate(indices):
12955 : * if PyIndex_Check(index):
12956 : * cindex = index # <<<<<<<<<<<<<<
12957 : * slice_memviewslice(
12958 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12959 : */
12960 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
12961 0 : __pyx_v_cindex = __pyx_t_9;
12962 :
12963 : /* "View.MemoryView":750
12964 : * if PyIndex_Check(index):
12965 : * cindex = index
12966 : * slice_memviewslice( # <<<<<<<<<<<<<<
12967 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12968 : * dim, new_ndim, p_suboffset_dim,
12969 : */
12970 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12971 :
12972 : /* "View.MemoryView":748
12973 : *
12974 : * for dim, index in enumerate(indices):
12975 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12976 : * cindex = index
12977 : * slice_memviewslice(
12978 : */
12979 0 : goto __pyx_L6;
12980 : }
12981 :
12982 : /* "View.MemoryView":756
12983 : * 0, 0, 0, # have_{start,stop,step}
12984 : * False)
12985 : * elif index is None: # <<<<<<<<<<<<<<
12986 : * p_dst.shape[new_ndim] = 1
12987 : * p_dst.strides[new_ndim] = 0
12988 : */
12989 0 : __pyx_t_1 = (__pyx_v_index == Py_None);
12990 0 : if (__pyx_t_1) {
12991 :
12992 : /* "View.MemoryView":757
12993 : * False)
12994 : * elif index is None:
12995 : * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
12996 : * p_dst.strides[new_ndim] = 0
12997 : * p_dst.suboffsets[new_ndim] = -1
12998 : */
12999 0 : (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13000 :
13001 : /* "View.MemoryView":758
13002 : * elif index is None:
13003 : * p_dst.shape[new_ndim] = 1
13004 : * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13005 : * p_dst.suboffsets[new_ndim] = -1
13006 : * new_ndim += 1
13007 : */
13008 0 : (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13009 :
13010 : /* "View.MemoryView":759
13011 : * p_dst.shape[new_ndim] = 1
13012 : * p_dst.strides[new_ndim] = 0
13013 : * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13014 : * new_ndim += 1
13015 : * else:
13016 : */
13017 0 : (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13018 :
13019 : /* "View.MemoryView":760
13020 : * p_dst.strides[new_ndim] = 0
13021 : * p_dst.suboffsets[new_ndim] = -1
13022 : * new_ndim += 1 # <<<<<<<<<<<<<<
13023 : * else:
13024 : * start = index.start or 0
13025 : */
13026 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13027 :
13028 : /* "View.MemoryView":756
13029 : * 0, 0, 0, # have_{start,stop,step}
13030 : * False)
13031 : * elif index is None: # <<<<<<<<<<<<<<
13032 : * p_dst.shape[new_ndim] = 1
13033 : * p_dst.strides[new_ndim] = 0
13034 : */
13035 0 : goto __pyx_L6;
13036 : }
13037 :
13038 : /* "View.MemoryView":762
13039 : * new_ndim += 1
13040 : * else:
13041 : * start = index.start or 0 # <<<<<<<<<<<<<<
13042 : * stop = index.stop or 0
13043 : * step = index.step or 0
13044 : */
13045 : /*else*/ {
13046 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
13047 0 : __Pyx_GOTREF(__pyx_t_8);
13048 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
13049 0 : if (!__pyx_t_1) {
13050 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13051 : } else {
13052 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
13053 0 : __pyx_t_9 = __pyx_t_11;
13054 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13055 0 : goto __pyx_L7_bool_binop_done;
13056 : }
13057 : __pyx_t_9 = 0;
13058 0 : __pyx_L7_bool_binop_done:;
13059 0 : __pyx_v_start = __pyx_t_9;
13060 :
13061 : /* "View.MemoryView":763
13062 : * else:
13063 : * start = index.start or 0
13064 : * stop = index.stop or 0 # <<<<<<<<<<<<<<
13065 : * step = index.step or 0
13066 : *
13067 : */
13068 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
13069 0 : __Pyx_GOTREF(__pyx_t_8);
13070 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
13071 0 : if (!__pyx_t_1) {
13072 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13073 : } else {
13074 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
13075 0 : __pyx_t_9 = __pyx_t_11;
13076 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13077 0 : goto __pyx_L9_bool_binop_done;
13078 : }
13079 : __pyx_t_9 = 0;
13080 0 : __pyx_L9_bool_binop_done:;
13081 0 : __pyx_v_stop = __pyx_t_9;
13082 :
13083 : /* "View.MemoryView":764
13084 : * start = index.start or 0
13085 : * stop = index.stop or 0
13086 : * step = index.step or 0 # <<<<<<<<<<<<<<
13087 : *
13088 : * have_start = index.start is not None
13089 : */
13090 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
13091 0 : __Pyx_GOTREF(__pyx_t_8);
13092 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
13093 0 : if (!__pyx_t_1) {
13094 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13095 : } else {
13096 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
13097 0 : __pyx_t_9 = __pyx_t_11;
13098 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13099 0 : goto __pyx_L11_bool_binop_done;
13100 : }
13101 : __pyx_t_9 = 0;
13102 0 : __pyx_L11_bool_binop_done:;
13103 0 : __pyx_v_step = __pyx_t_9;
13104 :
13105 : /* "View.MemoryView":766
13106 : * step = index.step or 0
13107 : *
13108 : * have_start = index.start is not None # <<<<<<<<<<<<<<
13109 : * have_stop = index.stop is not None
13110 : * have_step = index.step is not None
13111 : */
13112 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
13113 0 : __Pyx_GOTREF(__pyx_t_8);
13114 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13115 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13116 0 : __pyx_v_have_start = __pyx_t_1;
13117 :
13118 : /* "View.MemoryView":767
13119 : *
13120 : * have_start = index.start is not None
13121 : * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13122 : * have_step = index.step is not None
13123 : *
13124 : */
13125 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
13126 0 : __Pyx_GOTREF(__pyx_t_8);
13127 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13128 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13129 0 : __pyx_v_have_stop = __pyx_t_1;
13130 :
13131 : /* "View.MemoryView":768
13132 : * have_start = index.start is not None
13133 : * have_stop = index.stop is not None
13134 : * have_step = index.step is not None # <<<<<<<<<<<<<<
13135 : *
13136 : * slice_memviewslice(
13137 : */
13138 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
13139 0 : __Pyx_GOTREF(__pyx_t_8);
13140 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13141 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13142 0 : __pyx_v_have_step = __pyx_t_1;
13143 :
13144 : /* "View.MemoryView":770
13145 : * have_step = index.step is not None
13146 : *
13147 : * slice_memviewslice( # <<<<<<<<<<<<<<
13148 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13149 : * dim, new_ndim, p_suboffset_dim,
13150 : */
13151 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
13152 :
13153 : /* "View.MemoryView":776
13154 : * have_start, have_stop, have_step,
13155 : * True)
13156 : * new_ndim += 1 # <<<<<<<<<<<<<<
13157 : *
13158 : * if isinstance(memview, _memoryviewslice):
13159 : */
13160 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13161 : }
13162 0 : __pyx_L6:;
13163 :
13164 : /* "View.MemoryView":747
13165 : * cdef bint have_start, have_stop, have_step
13166 : *
13167 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13168 : * if PyIndex_Check(index):
13169 : * cindex = index
13170 : */
13171 : }
13172 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13173 :
13174 : /* "View.MemoryView":778
13175 : * new_ndim += 1
13176 : *
13177 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13178 : * return memoryview_fromslice(dst, new_ndim,
13179 : * memviewsliceobj.to_object_func,
13180 : */
13181 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13182 0 : if (__pyx_t_1) {
13183 :
13184 : /* "View.MemoryView":779
13185 : *
13186 : * if isinstance(memview, _memoryviewslice):
13187 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13188 : * memviewsliceobj.to_object_func,
13189 : * memviewsliceobj.to_dtype_func,
13190 : */
13191 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13192 :
13193 : /* "View.MemoryView":780
13194 : * if isinstance(memview, _memoryviewslice):
13195 : * return memoryview_fromslice(dst, new_ndim,
13196 : * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
13197 : * memviewsliceobj.to_dtype_func,
13198 : * memview.dtype_is_object)
13199 : */
13200 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
13201 :
13202 : /* "View.MemoryView":781
13203 : * return memoryview_fromslice(dst, new_ndim,
13204 : * memviewsliceobj.to_object_func,
13205 : * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
13206 : * memview.dtype_is_object)
13207 : * else:
13208 : */
13209 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
13210 :
13211 : /* "View.MemoryView":779
13212 : *
13213 : * if isinstance(memview, _memoryviewslice):
13214 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13215 : * memviewsliceobj.to_object_func,
13216 : * memviewsliceobj.to_dtype_func,
13217 : */
13218 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
13219 0 : __Pyx_GOTREF(__pyx_t_2);
13220 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
13221 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13222 0 : __pyx_t_2 = 0;
13223 0 : goto __pyx_L0;
13224 :
13225 : /* "View.MemoryView":778
13226 : * new_ndim += 1
13227 : *
13228 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13229 : * return memoryview_fromslice(dst, new_ndim,
13230 : * memviewsliceobj.to_object_func,
13231 : */
13232 : }
13233 :
13234 : /* "View.MemoryView":784
13235 : * memview.dtype_is_object)
13236 : * else:
13237 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13238 : * memview.dtype_is_object)
13239 : *
13240 : */
13241 : /*else*/ {
13242 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13243 :
13244 : /* "View.MemoryView":785
13245 : * else:
13246 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13247 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
13248 : *
13249 : *
13250 : */
13251 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
13252 0 : __Pyx_GOTREF(__pyx_t_2);
13253 :
13254 : /* "View.MemoryView":784
13255 : * memview.dtype_is_object)
13256 : * else:
13257 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13258 : * memview.dtype_is_object)
13259 : *
13260 : */
13261 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
13262 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13263 0 : __pyx_t_2 = 0;
13264 0 : goto __pyx_L0;
13265 : }
13266 :
13267 : /* "View.MemoryView":711
13268 : *
13269 : * @cname('__pyx_memview_slice')
13270 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13271 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13272 : * cdef bint negative_step
13273 : */
13274 :
13275 : /* function exit code */
13276 0 : __pyx_L1_error:;
13277 0 : __Pyx_XDECREF(__pyx_t_2);
13278 0 : __Pyx_XDECREF(__pyx_t_8);
13279 0 : __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13280 0 : __pyx_r = 0;
13281 0 : __pyx_L0:;
13282 0 : __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13283 0 : __Pyx_XDECREF(__pyx_v_index);
13284 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
13285 0 : __Pyx_RefNannyFinishContext();
13286 0 : return __pyx_r;
13287 : }
13288 :
13289 : /* "View.MemoryView":793
13290 : *
13291 : * @cname('__pyx_memoryview_slice_memviewslice')
13292 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13293 : * __Pyx_memviewslice *dst,
13294 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13295 : */
13296 :
13297 0 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
13298 0 : Py_ssize_t __pyx_v_new_shape;
13299 0 : int __pyx_v_negative_step;
13300 0 : int __pyx_r;
13301 0 : int __pyx_t_1;
13302 0 : int __pyx_t_2;
13303 0 : int __pyx_t_3;
13304 0 : int __pyx_lineno = 0;
13305 0 : const char *__pyx_filename = NULL;
13306 0 : int __pyx_clineno = 0;
13307 : #ifdef WITH_THREAD
13308 0 : PyGILState_STATE __pyx_gilstate_save;
13309 : #endif
13310 :
13311 : /* "View.MemoryView":813
13312 : * cdef bint negative_step
13313 : *
13314 : * if not is_slice: # <<<<<<<<<<<<<<
13315 : *
13316 : * if start < 0:
13317 : */
13318 0 : __pyx_t_1 = (!__pyx_v_is_slice);
13319 0 : if (__pyx_t_1) {
13320 :
13321 : /* "View.MemoryView":815
13322 : * if not is_slice:
13323 : *
13324 : * if start < 0: # <<<<<<<<<<<<<<
13325 : * start += shape
13326 : * if not 0 <= start < shape:
13327 : */
13328 0 : __pyx_t_1 = (__pyx_v_start < 0);
13329 0 : if (__pyx_t_1) {
13330 :
13331 : /* "View.MemoryView":816
13332 : *
13333 : * if start < 0:
13334 : * start += shape # <<<<<<<<<<<<<<
13335 : * if not 0 <= start < shape:
13336 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13337 : */
13338 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13339 :
13340 : /* "View.MemoryView":815
13341 : * if not is_slice:
13342 : *
13343 : * if start < 0: # <<<<<<<<<<<<<<
13344 : * start += shape
13345 : * if not 0 <= start < shape:
13346 : */
13347 : }
13348 :
13349 : /* "View.MemoryView":817
13350 : * if start < 0:
13351 : * start += shape
13352 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13353 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13354 : * else:
13355 : */
13356 0 : __pyx_t_1 = (0 <= __pyx_v_start);
13357 0 : if (__pyx_t_1) {
13358 0 : __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13359 : }
13360 0 : __pyx_t_2 = (!__pyx_t_1);
13361 0 : if (__pyx_t_2) {
13362 :
13363 : /* "View.MemoryView":818
13364 : * start += shape
13365 : * if not 0 <= start < shape:
13366 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
13367 : * else:
13368 : *
13369 : */
13370 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
13371 :
13372 : /* "View.MemoryView":817
13373 : * if start < 0:
13374 : * start += shape
13375 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13376 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13377 : * else:
13378 : */
13379 : }
13380 :
13381 : /* "View.MemoryView":813
13382 : * cdef bint negative_step
13383 : *
13384 : * if not is_slice: # <<<<<<<<<<<<<<
13385 : *
13386 : * if start < 0:
13387 : */
13388 0 : goto __pyx_L3;
13389 : }
13390 :
13391 : /* "View.MemoryView":821
13392 : * else:
13393 : *
13394 : * if have_step: # <<<<<<<<<<<<<<
13395 : * negative_step = step < 0
13396 : * if step == 0:
13397 : */
13398 : /*else*/ {
13399 0 : __pyx_t_2 = (__pyx_v_have_step != 0);
13400 0 : if (__pyx_t_2) {
13401 :
13402 : /* "View.MemoryView":822
13403 : *
13404 : * if have_step:
13405 : * negative_step = step < 0 # <<<<<<<<<<<<<<
13406 : * if step == 0:
13407 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13408 : */
13409 0 : __pyx_v_negative_step = (__pyx_v_step < 0);
13410 :
13411 : /* "View.MemoryView":823
13412 : * if have_step:
13413 : * negative_step = step < 0
13414 : * if step == 0: # <<<<<<<<<<<<<<
13415 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13416 : * else:
13417 : */
13418 0 : __pyx_t_2 = (__pyx_v_step == 0);
13419 0 : if (__pyx_t_2) {
13420 :
13421 : /* "View.MemoryView":824
13422 : * negative_step = step < 0
13423 : * if step == 0:
13424 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
13425 : * else:
13426 : * negative_step = False
13427 : */
13428 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
13429 :
13430 : /* "View.MemoryView":823
13431 : * if have_step:
13432 : * negative_step = step < 0
13433 : * if step == 0: # <<<<<<<<<<<<<<
13434 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13435 : * else:
13436 : */
13437 : }
13438 :
13439 : /* "View.MemoryView":821
13440 : * else:
13441 : *
13442 : * if have_step: # <<<<<<<<<<<<<<
13443 : * negative_step = step < 0
13444 : * if step == 0:
13445 : */
13446 0 : goto __pyx_L6;
13447 : }
13448 :
13449 : /* "View.MemoryView":826
13450 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13451 : * else:
13452 : * negative_step = False # <<<<<<<<<<<<<<
13453 : * step = 1
13454 : *
13455 : */
13456 : /*else*/ {
13457 : __pyx_v_negative_step = 0;
13458 :
13459 : /* "View.MemoryView":827
13460 : * else:
13461 : * negative_step = False
13462 : * step = 1 # <<<<<<<<<<<<<<
13463 : *
13464 : *
13465 : */
13466 : __pyx_v_step = 1;
13467 : }
13468 0 : __pyx_L6:;
13469 :
13470 : /* "View.MemoryView":830
13471 : *
13472 : *
13473 : * if have_start: # <<<<<<<<<<<<<<
13474 : * if start < 0:
13475 : * start += shape
13476 : */
13477 0 : __pyx_t_2 = (__pyx_v_have_start != 0);
13478 0 : if (__pyx_t_2) {
13479 :
13480 : /* "View.MemoryView":831
13481 : *
13482 : * if have_start:
13483 : * if start < 0: # <<<<<<<<<<<<<<
13484 : * start += shape
13485 : * if start < 0:
13486 : */
13487 0 : __pyx_t_2 = (__pyx_v_start < 0);
13488 0 : if (__pyx_t_2) {
13489 :
13490 : /* "View.MemoryView":832
13491 : * if have_start:
13492 : * if start < 0:
13493 : * start += shape # <<<<<<<<<<<<<<
13494 : * if start < 0:
13495 : * start = 0
13496 : */
13497 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13498 :
13499 : /* "View.MemoryView":833
13500 : * if start < 0:
13501 : * start += shape
13502 : * if start < 0: # <<<<<<<<<<<<<<
13503 : * start = 0
13504 : * elif start >= shape:
13505 : */
13506 0 : __pyx_t_2 = (__pyx_v_start < 0);
13507 0 : if (__pyx_t_2) {
13508 :
13509 : /* "View.MemoryView":834
13510 : * start += shape
13511 : * if start < 0:
13512 : * start = 0 # <<<<<<<<<<<<<<
13513 : * elif start >= shape:
13514 : * if negative_step:
13515 : */
13516 : __pyx_v_start = 0;
13517 :
13518 : /* "View.MemoryView":833
13519 : * if start < 0:
13520 : * start += shape
13521 : * if start < 0: # <<<<<<<<<<<<<<
13522 : * start = 0
13523 : * elif start >= shape:
13524 : */
13525 : }
13526 :
13527 : /* "View.MemoryView":831
13528 : *
13529 : * if have_start:
13530 : * if start < 0: # <<<<<<<<<<<<<<
13531 : * start += shape
13532 : * if start < 0:
13533 : */
13534 0 : goto __pyx_L9;
13535 : }
13536 :
13537 : /* "View.MemoryView":835
13538 : * if start < 0:
13539 : * start = 0
13540 : * elif start >= shape: # <<<<<<<<<<<<<<
13541 : * if negative_step:
13542 : * start = shape - 1
13543 : */
13544 0 : __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
13545 0 : if (__pyx_t_2) {
13546 :
13547 : /* "View.MemoryView":836
13548 : * start = 0
13549 : * elif start >= shape:
13550 : * if negative_step: # <<<<<<<<<<<<<<
13551 : * start = shape - 1
13552 : * else:
13553 : */
13554 0 : if (__pyx_v_negative_step) {
13555 :
13556 : /* "View.MemoryView":837
13557 : * elif start >= shape:
13558 : * if negative_step:
13559 : * start = shape - 1 # <<<<<<<<<<<<<<
13560 : * else:
13561 : * start = shape
13562 : */
13563 0 : __pyx_v_start = (__pyx_v_shape - 1);
13564 :
13565 : /* "View.MemoryView":836
13566 : * start = 0
13567 : * elif start >= shape:
13568 : * if negative_step: # <<<<<<<<<<<<<<
13569 : * start = shape - 1
13570 : * else:
13571 : */
13572 0 : goto __pyx_L11;
13573 : }
13574 :
13575 : /* "View.MemoryView":839
13576 : * start = shape - 1
13577 : * else:
13578 : * start = shape # <<<<<<<<<<<<<<
13579 : * else:
13580 : * if negative_step:
13581 : */
13582 : /*else*/ {
13583 : __pyx_v_start = __pyx_v_shape;
13584 : }
13585 0 : __pyx_L11:;
13586 :
13587 : /* "View.MemoryView":835
13588 : * if start < 0:
13589 : * start = 0
13590 : * elif start >= shape: # <<<<<<<<<<<<<<
13591 : * if negative_step:
13592 : * start = shape - 1
13593 : */
13594 : }
13595 0 : __pyx_L9:;
13596 :
13597 : /* "View.MemoryView":830
13598 : *
13599 : *
13600 : * if have_start: # <<<<<<<<<<<<<<
13601 : * if start < 0:
13602 : * start += shape
13603 : */
13604 0 : goto __pyx_L8;
13605 : }
13606 :
13607 : /* "View.MemoryView":841
13608 : * start = shape
13609 : * else:
13610 : * if negative_step: # <<<<<<<<<<<<<<
13611 : * start = shape - 1
13612 : * else:
13613 : */
13614 : /*else*/ {
13615 0 : if (__pyx_v_negative_step) {
13616 :
13617 : /* "View.MemoryView":842
13618 : * else:
13619 : * if negative_step:
13620 : * start = shape - 1 # <<<<<<<<<<<<<<
13621 : * else:
13622 : * start = 0
13623 : */
13624 0 : __pyx_v_start = (__pyx_v_shape - 1);
13625 :
13626 : /* "View.MemoryView":841
13627 : * start = shape
13628 : * else:
13629 : * if negative_step: # <<<<<<<<<<<<<<
13630 : * start = shape - 1
13631 : * else:
13632 : */
13633 0 : goto __pyx_L12;
13634 : }
13635 :
13636 : /* "View.MemoryView":844
13637 : * start = shape - 1
13638 : * else:
13639 : * start = 0 # <<<<<<<<<<<<<<
13640 : *
13641 : * if have_stop:
13642 : */
13643 : /*else*/ {
13644 : __pyx_v_start = 0;
13645 : }
13646 0 : __pyx_L12:;
13647 : }
13648 0 : __pyx_L8:;
13649 :
13650 : /* "View.MemoryView":846
13651 : * start = 0
13652 : *
13653 : * if have_stop: # <<<<<<<<<<<<<<
13654 : * if stop < 0:
13655 : * stop += shape
13656 : */
13657 0 : __pyx_t_2 = (__pyx_v_have_stop != 0);
13658 0 : if (__pyx_t_2) {
13659 :
13660 : /* "View.MemoryView":847
13661 : *
13662 : * if have_stop:
13663 : * if stop < 0: # <<<<<<<<<<<<<<
13664 : * stop += shape
13665 : * if stop < 0:
13666 : */
13667 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13668 0 : if (__pyx_t_2) {
13669 :
13670 : /* "View.MemoryView":848
13671 : * if have_stop:
13672 : * if stop < 0:
13673 : * stop += shape # <<<<<<<<<<<<<<
13674 : * if stop < 0:
13675 : * stop = 0
13676 : */
13677 0 : __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
13678 :
13679 : /* "View.MemoryView":849
13680 : * if stop < 0:
13681 : * stop += shape
13682 : * if stop < 0: # <<<<<<<<<<<<<<
13683 : * stop = 0
13684 : * elif stop > shape:
13685 : */
13686 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13687 0 : if (__pyx_t_2) {
13688 :
13689 : /* "View.MemoryView":850
13690 : * stop += shape
13691 : * if stop < 0:
13692 : * stop = 0 # <<<<<<<<<<<<<<
13693 : * elif stop > shape:
13694 : * stop = shape
13695 : */
13696 : __pyx_v_stop = 0;
13697 :
13698 : /* "View.MemoryView":849
13699 : * if stop < 0:
13700 : * stop += shape
13701 : * if stop < 0: # <<<<<<<<<<<<<<
13702 : * stop = 0
13703 : * elif stop > shape:
13704 : */
13705 : }
13706 :
13707 : /* "View.MemoryView":847
13708 : *
13709 : * if have_stop:
13710 : * if stop < 0: # <<<<<<<<<<<<<<
13711 : * stop += shape
13712 : * if stop < 0:
13713 : */
13714 0 : goto __pyx_L14;
13715 : }
13716 :
13717 : /* "View.MemoryView":851
13718 : * if stop < 0:
13719 : * stop = 0
13720 : * elif stop > shape: # <<<<<<<<<<<<<<
13721 : * stop = shape
13722 : * else:
13723 : */
13724 0 : __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
13725 0 : if (__pyx_t_2) {
13726 :
13727 : /* "View.MemoryView":852
13728 : * stop = 0
13729 : * elif stop > shape:
13730 : * stop = shape # <<<<<<<<<<<<<<
13731 : * else:
13732 : * if negative_step:
13733 : */
13734 : __pyx_v_stop = __pyx_v_shape;
13735 :
13736 : /* "View.MemoryView":851
13737 : * if stop < 0:
13738 : * stop = 0
13739 : * elif stop > shape: # <<<<<<<<<<<<<<
13740 : * stop = shape
13741 : * else:
13742 : */
13743 : }
13744 0 : __pyx_L14:;
13745 :
13746 : /* "View.MemoryView":846
13747 : * start = 0
13748 : *
13749 : * if have_stop: # <<<<<<<<<<<<<<
13750 : * if stop < 0:
13751 : * stop += shape
13752 : */
13753 0 : goto __pyx_L13;
13754 : }
13755 :
13756 : /* "View.MemoryView":854
13757 : * stop = shape
13758 : * else:
13759 : * if negative_step: # <<<<<<<<<<<<<<
13760 : * stop = -1
13761 : * else:
13762 : */
13763 : /*else*/ {
13764 0 : if (__pyx_v_negative_step) {
13765 :
13766 : /* "View.MemoryView":855
13767 : * else:
13768 : * if negative_step:
13769 : * stop = -1 # <<<<<<<<<<<<<<
13770 : * else:
13771 : * stop = shape
13772 : */
13773 0 : __pyx_v_stop = -1L;
13774 :
13775 : /* "View.MemoryView":854
13776 : * stop = shape
13777 : * else:
13778 : * if negative_step: # <<<<<<<<<<<<<<
13779 : * stop = -1
13780 : * else:
13781 : */
13782 0 : goto __pyx_L16;
13783 : }
13784 :
13785 : /* "View.MemoryView":857
13786 : * stop = -1
13787 : * else:
13788 : * stop = shape # <<<<<<<<<<<<<<
13789 : *
13790 : *
13791 : */
13792 : /*else*/ {
13793 : __pyx_v_stop = __pyx_v_shape;
13794 : }
13795 0 : __pyx_L16:;
13796 : }
13797 0 : __pyx_L13:;
13798 :
13799 : /* "View.MemoryView":861
13800 : *
13801 : * with cython.cdivision(True):
13802 : * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
13803 : *
13804 : * if (stop - start) - step * new_shape:
13805 : */
13806 0 : __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
13807 :
13808 : /* "View.MemoryView":863
13809 : * new_shape = (stop - start) // step
13810 : *
13811 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13812 : * new_shape += 1
13813 : *
13814 : */
13815 0 : __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
13816 0 : if (__pyx_t_2) {
13817 :
13818 : /* "View.MemoryView":864
13819 : *
13820 : * if (stop - start) - step * new_shape:
13821 : * new_shape += 1 # <<<<<<<<<<<<<<
13822 : *
13823 : * if new_shape < 0:
13824 : */
13825 0 : __pyx_v_new_shape = (__pyx_v_new_shape + 1);
13826 :
13827 : /* "View.MemoryView":863
13828 : * new_shape = (stop - start) // step
13829 : *
13830 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13831 : * new_shape += 1
13832 : *
13833 : */
13834 : }
13835 :
13836 : /* "View.MemoryView":866
13837 : * new_shape += 1
13838 : *
13839 : * if new_shape < 0: # <<<<<<<<<<<<<<
13840 : * new_shape = 0
13841 : *
13842 : */
13843 0 : __pyx_t_2 = (__pyx_v_new_shape < 0);
13844 0 : if (__pyx_t_2) {
13845 :
13846 : /* "View.MemoryView":867
13847 : *
13848 : * if new_shape < 0:
13849 : * new_shape = 0 # <<<<<<<<<<<<<<
13850 : *
13851 : *
13852 : */
13853 : __pyx_v_new_shape = 0;
13854 :
13855 : /* "View.MemoryView":866
13856 : * new_shape += 1
13857 : *
13858 : * if new_shape < 0: # <<<<<<<<<<<<<<
13859 : * new_shape = 0
13860 : *
13861 : */
13862 : }
13863 :
13864 : /* "View.MemoryView":870
13865 : *
13866 : *
13867 : * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
13868 : * dst.shape[new_ndim] = new_shape
13869 : * dst.suboffsets[new_ndim] = suboffset
13870 : */
13871 0 : (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
13872 :
13873 : /* "View.MemoryView":871
13874 : *
13875 : * dst.strides[new_ndim] = stride * step
13876 : * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
13877 : * dst.suboffsets[new_ndim] = suboffset
13878 : *
13879 : */
13880 0 : (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
13881 :
13882 : /* "View.MemoryView":872
13883 : * dst.strides[new_ndim] = stride * step
13884 : * dst.shape[new_ndim] = new_shape
13885 : * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
13886 : *
13887 : *
13888 : */
13889 0 : (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
13890 : }
13891 0 : __pyx_L3:;
13892 :
13893 : /* "View.MemoryView":875
13894 : *
13895 : *
13896 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13897 : * dst.data += start * stride
13898 : * else:
13899 : */
13900 0 : __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
13901 0 : if (__pyx_t_2) {
13902 :
13903 : /* "View.MemoryView":876
13904 : *
13905 : * if suboffset_dim[0] < 0:
13906 : * dst.data += start * stride # <<<<<<<<<<<<<<
13907 : * else:
13908 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13909 : */
13910 0 : __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
13911 :
13912 : /* "View.MemoryView":875
13913 : *
13914 : *
13915 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13916 : * dst.data += start * stride
13917 : * else:
13918 : */
13919 0 : goto __pyx_L19;
13920 : }
13921 :
13922 : /* "View.MemoryView":878
13923 : * dst.data += start * stride
13924 : * else:
13925 : * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
13926 : *
13927 : * if suboffset >= 0:
13928 : */
13929 : /*else*/ {
13930 0 : __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
13931 0 : (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
13932 : }
13933 0 : __pyx_L19:;
13934 :
13935 : /* "View.MemoryView":880
13936 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13937 : *
13938 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13939 : * if not is_slice:
13940 : * if new_ndim == 0:
13941 : */
13942 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
13943 0 : if (__pyx_t_2) {
13944 :
13945 : /* "View.MemoryView":881
13946 : *
13947 : * if suboffset >= 0:
13948 : * if not is_slice: # <<<<<<<<<<<<<<
13949 : * if new_ndim == 0:
13950 : * dst.data = (<char **> dst.data)[0] + suboffset
13951 : */
13952 0 : __pyx_t_2 = (!__pyx_v_is_slice);
13953 0 : if (__pyx_t_2) {
13954 :
13955 : /* "View.MemoryView":882
13956 : * if suboffset >= 0:
13957 : * if not is_slice:
13958 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13959 : * dst.data = (<char **> dst.data)[0] + suboffset
13960 : * else:
13961 : */
13962 0 : __pyx_t_2 = (__pyx_v_new_ndim == 0);
13963 0 : if (__pyx_t_2) {
13964 :
13965 : /* "View.MemoryView":883
13966 : * if not is_slice:
13967 : * if new_ndim == 0:
13968 : * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
13969 : * else:
13970 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13971 : */
13972 0 : __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
13973 :
13974 : /* "View.MemoryView":882
13975 : * if suboffset >= 0:
13976 : * if not is_slice:
13977 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13978 : * dst.data = (<char **> dst.data)[0] + suboffset
13979 : * else:
13980 : */
13981 0 : goto __pyx_L22;
13982 : }
13983 :
13984 : /* "View.MemoryView":885
13985 : * dst.data = (<char **> dst.data)[0] + suboffset
13986 : * else:
13987 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
13988 : * "must be indexed and not sliced", dim)
13989 : * else:
13990 : */
13991 : /*else*/ {
13992 :
13993 : /* "View.MemoryView":886
13994 : * else:
13995 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13996 : * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
13997 : * else:
13998 : * suboffset_dim[0] = new_ndim
13999 : */
14000 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
14001 : }
14002 0 : __pyx_L22:;
14003 :
14004 : /* "View.MemoryView":881
14005 : *
14006 : * if suboffset >= 0:
14007 : * if not is_slice: # <<<<<<<<<<<<<<
14008 : * if new_ndim == 0:
14009 : * dst.data = (<char **> dst.data)[0] + suboffset
14010 : */
14011 0 : goto __pyx_L21;
14012 : }
14013 :
14014 : /* "View.MemoryView":888
14015 : * "must be indexed and not sliced", dim)
14016 : * else:
14017 : * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
14018 : *
14019 : * return 0
14020 : */
14021 : /*else*/ {
14022 0 : (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14023 : }
14024 0 : __pyx_L21:;
14025 :
14026 : /* "View.MemoryView":880
14027 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14028 : *
14029 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14030 : * if not is_slice:
14031 : * if new_ndim == 0:
14032 : */
14033 : }
14034 :
14035 : /* "View.MemoryView":890
14036 : * suboffset_dim[0] = new_ndim
14037 : *
14038 : * return 0 # <<<<<<<<<<<<<<
14039 : *
14040 : *
14041 : */
14042 0 : __pyx_r = 0;
14043 0 : goto __pyx_L0;
14044 :
14045 : /* "View.MemoryView":793
14046 : *
14047 : * @cname('__pyx_memoryview_slice_memviewslice')
14048 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14049 : * __Pyx_memviewslice *dst,
14050 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14051 : */
14052 :
14053 : /* function exit code */
14054 0 : __pyx_L1_error:;
14055 : #ifdef WITH_THREAD
14056 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14057 : #endif
14058 0 : __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14059 0 : __pyx_r = -1;
14060 : #ifdef WITH_THREAD
14061 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14062 : #endif
14063 0 : __pyx_L0:;
14064 0 : return __pyx_r;
14065 : }
14066 :
14067 : /* "View.MemoryView":896
14068 : *
14069 : * @cname('__pyx_pybuffer_index')
14070 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14071 : * Py_ssize_t dim) except NULL:
14072 : * cdef Py_ssize_t shape, stride, suboffset = -1
14073 : */
14074 :
14075 0 : static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14076 0 : Py_ssize_t __pyx_v_shape;
14077 0 : Py_ssize_t __pyx_v_stride;
14078 0 : Py_ssize_t __pyx_v_suboffset;
14079 0 : Py_ssize_t __pyx_v_itemsize;
14080 0 : char *__pyx_v_resultp;
14081 0 : char *__pyx_r;
14082 : __Pyx_RefNannyDeclarations
14083 0 : Py_ssize_t __pyx_t_1;
14084 0 : int __pyx_t_2;
14085 0 : PyObject *__pyx_t_3 = NULL;
14086 0 : Py_UCS4 __pyx_t_4;
14087 0 : PyObject *__pyx_t_5 = NULL;
14088 0 : int __pyx_lineno = 0;
14089 0 : const char *__pyx_filename = NULL;
14090 0 : int __pyx_clineno = 0;
14091 0 : __Pyx_RefNannySetupContext("pybuffer_index", 1);
14092 :
14093 : /* "View.MemoryView":898
14094 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14095 : * Py_ssize_t dim) except NULL:
14096 : * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14097 : * cdef Py_ssize_t itemsize = view.itemsize
14098 : * cdef char *resultp
14099 : */
14100 0 : __pyx_v_suboffset = -1L;
14101 :
14102 : /* "View.MemoryView":899
14103 : * Py_ssize_t dim) except NULL:
14104 : * cdef Py_ssize_t shape, stride, suboffset = -1
14105 : * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14106 : * cdef char *resultp
14107 : *
14108 : */
14109 0 : __pyx_t_1 = __pyx_v_view->itemsize;
14110 0 : __pyx_v_itemsize = __pyx_t_1;
14111 :
14112 : /* "View.MemoryView":902
14113 : * cdef char *resultp
14114 : *
14115 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14116 : * shape = view.len // itemsize
14117 : * stride = itemsize
14118 : */
14119 0 : __pyx_t_2 = (__pyx_v_view->ndim == 0);
14120 0 : if (__pyx_t_2) {
14121 :
14122 : /* "View.MemoryView":903
14123 : *
14124 : * if view.ndim == 0:
14125 : * shape = view.len // itemsize # <<<<<<<<<<<<<<
14126 : * stride = itemsize
14127 : * else:
14128 : */
14129 0 : if (unlikely(__pyx_v_itemsize == 0)) {
14130 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14131 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14132 : }
14133 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14134 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14135 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14136 : }
14137 0 : __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14138 :
14139 : /* "View.MemoryView":904
14140 : * if view.ndim == 0:
14141 : * shape = view.len // itemsize
14142 : * stride = itemsize # <<<<<<<<<<<<<<
14143 : * else:
14144 : * shape = view.shape[dim]
14145 : */
14146 0 : __pyx_v_stride = __pyx_v_itemsize;
14147 :
14148 : /* "View.MemoryView":902
14149 : * cdef char *resultp
14150 : *
14151 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14152 : * shape = view.len // itemsize
14153 : * stride = itemsize
14154 : */
14155 0 : goto __pyx_L3;
14156 : }
14157 :
14158 : /* "View.MemoryView":906
14159 : * stride = itemsize
14160 : * else:
14161 : * shape = view.shape[dim] # <<<<<<<<<<<<<<
14162 : * stride = view.strides[dim]
14163 : * if view.suboffsets != NULL:
14164 : */
14165 : /*else*/ {
14166 0 : __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14167 :
14168 : /* "View.MemoryView":907
14169 : * else:
14170 : * shape = view.shape[dim]
14171 : * stride = view.strides[dim] # <<<<<<<<<<<<<<
14172 : * if view.suboffsets != NULL:
14173 : * suboffset = view.suboffsets[dim]
14174 : */
14175 0 : __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14176 :
14177 : /* "View.MemoryView":908
14178 : * shape = view.shape[dim]
14179 : * stride = view.strides[dim]
14180 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14181 : * suboffset = view.suboffsets[dim]
14182 : *
14183 : */
14184 0 : __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14185 0 : if (__pyx_t_2) {
14186 :
14187 : /* "View.MemoryView":909
14188 : * stride = view.strides[dim]
14189 : * if view.suboffsets != NULL:
14190 : * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14191 : *
14192 : * if index < 0:
14193 : */
14194 0 : __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14195 :
14196 : /* "View.MemoryView":908
14197 : * shape = view.shape[dim]
14198 : * stride = view.strides[dim]
14199 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14200 : * suboffset = view.suboffsets[dim]
14201 : *
14202 : */
14203 : }
14204 : }
14205 0 : __pyx_L3:;
14206 :
14207 : /* "View.MemoryView":911
14208 : * suboffset = view.suboffsets[dim]
14209 : *
14210 : * if index < 0: # <<<<<<<<<<<<<<
14211 : * index += view.shape[dim]
14212 : * if index < 0:
14213 : */
14214 0 : __pyx_t_2 = (__pyx_v_index < 0);
14215 0 : if (__pyx_t_2) {
14216 :
14217 : /* "View.MemoryView":912
14218 : *
14219 : * if index < 0:
14220 : * index += view.shape[dim] # <<<<<<<<<<<<<<
14221 : * if index < 0:
14222 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14223 : */
14224 0 : __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14225 :
14226 : /* "View.MemoryView":913
14227 : * if index < 0:
14228 : * index += view.shape[dim]
14229 : * if index < 0: # <<<<<<<<<<<<<<
14230 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14231 : *
14232 : */
14233 0 : __pyx_t_2 = (__pyx_v_index < 0);
14234 0 : if (unlikely(__pyx_t_2)) {
14235 :
14236 : /* "View.MemoryView":914
14237 : * index += view.shape[dim]
14238 : * if index < 0:
14239 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14240 : *
14241 : * if index >= shape:
14242 : */
14243 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
14244 0 : __Pyx_GOTREF(__pyx_t_3);
14245 0 : __pyx_t_1 = 0;
14246 0 : __pyx_t_4 = 127;
14247 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14248 0 : __pyx_t_1 += 37;
14249 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14250 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14251 0 : __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14252 0 : __Pyx_GOTREF(__pyx_t_5);
14253 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
14254 0 : __Pyx_GIVEREF(__pyx_t_5);
14255 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
14256 0 : __pyx_t_5 = 0;
14257 0 : __Pyx_INCREF(__pyx_kp_u__7);
14258 0 : __pyx_t_1 += 1;
14259 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14260 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
14261 0 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14262 0 : __Pyx_GOTREF(__pyx_t_5);
14263 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14264 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
14265 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14266 0 : __PYX_ERR(1, 914, __pyx_L1_error)
14267 :
14268 : /* "View.MemoryView":913
14269 : * if index < 0:
14270 : * index += view.shape[dim]
14271 : * if index < 0: # <<<<<<<<<<<<<<
14272 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14273 : *
14274 : */
14275 : }
14276 :
14277 : /* "View.MemoryView":911
14278 : * suboffset = view.suboffsets[dim]
14279 : *
14280 : * if index < 0: # <<<<<<<<<<<<<<
14281 : * index += view.shape[dim]
14282 : * if index < 0:
14283 : */
14284 : }
14285 :
14286 : /* "View.MemoryView":916
14287 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14288 : *
14289 : * if index >= shape: # <<<<<<<<<<<<<<
14290 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14291 : *
14292 : */
14293 0 : __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14294 0 : if (unlikely(__pyx_t_2)) {
14295 :
14296 : /* "View.MemoryView":917
14297 : *
14298 : * if index >= shape:
14299 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14300 : *
14301 : * resultp = bufp + index * stride
14302 : */
14303 0 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
14304 0 : __Pyx_GOTREF(__pyx_t_5);
14305 0 : __pyx_t_1 = 0;
14306 0 : __pyx_t_4 = 127;
14307 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14308 0 : __pyx_t_1 += 37;
14309 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14310 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14311 0 : __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14312 0 : __Pyx_GOTREF(__pyx_t_3);
14313 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
14314 0 : __Pyx_GIVEREF(__pyx_t_3);
14315 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
14316 0 : __pyx_t_3 = 0;
14317 0 : __Pyx_INCREF(__pyx_kp_u__7);
14318 0 : __pyx_t_1 += 1;
14319 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14320 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
14321 0 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14322 0 : __Pyx_GOTREF(__pyx_t_3);
14323 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14324 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
14325 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14326 0 : __PYX_ERR(1, 917, __pyx_L1_error)
14327 :
14328 : /* "View.MemoryView":916
14329 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14330 : *
14331 : * if index >= shape: # <<<<<<<<<<<<<<
14332 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14333 : *
14334 : */
14335 : }
14336 :
14337 : /* "View.MemoryView":919
14338 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14339 : *
14340 : * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14341 : * if suboffset >= 0:
14342 : * resultp = (<char **> resultp)[0] + suboffset
14343 : */
14344 0 : __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14345 :
14346 : /* "View.MemoryView":920
14347 : *
14348 : * resultp = bufp + index * stride
14349 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14350 : * resultp = (<char **> resultp)[0] + suboffset
14351 : *
14352 : */
14353 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
14354 0 : if (__pyx_t_2) {
14355 :
14356 : /* "View.MemoryView":921
14357 : * resultp = bufp + index * stride
14358 : * if suboffset >= 0:
14359 : * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14360 : *
14361 : * return resultp
14362 : */
14363 0 : __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14364 :
14365 : /* "View.MemoryView":920
14366 : *
14367 : * resultp = bufp + index * stride
14368 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14369 : * resultp = (<char **> resultp)[0] + suboffset
14370 : *
14371 : */
14372 : }
14373 :
14374 : /* "View.MemoryView":923
14375 : * resultp = (<char **> resultp)[0] + suboffset
14376 : *
14377 : * return resultp # <<<<<<<<<<<<<<
14378 : *
14379 : *
14380 : */
14381 0 : __pyx_r = __pyx_v_resultp;
14382 0 : goto __pyx_L0;
14383 :
14384 : /* "View.MemoryView":896
14385 : *
14386 : * @cname('__pyx_pybuffer_index')
14387 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14388 : * Py_ssize_t dim) except NULL:
14389 : * cdef Py_ssize_t shape, stride, suboffset = -1
14390 : */
14391 :
14392 : /* function exit code */
14393 0 : __pyx_L1_error:;
14394 0 : __Pyx_XDECREF(__pyx_t_3);
14395 0 : __Pyx_XDECREF(__pyx_t_5);
14396 0 : __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14397 0 : __pyx_r = NULL;
14398 0 : __pyx_L0:;
14399 0 : __Pyx_RefNannyFinishContext();
14400 0 : return __pyx_r;
14401 : }
14402 :
14403 : /* "View.MemoryView":929
14404 : *
14405 : * @cname('__pyx_memslice_transpose')
14406 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14407 : * cdef int ndim = memslice.memview.view.ndim
14408 : *
14409 : */
14410 :
14411 0 : static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14412 0 : int __pyx_v_ndim;
14413 0 : Py_ssize_t *__pyx_v_shape;
14414 0 : Py_ssize_t *__pyx_v_strides;
14415 0 : int __pyx_v_i;
14416 0 : int __pyx_v_j;
14417 0 : int __pyx_r;
14418 0 : int __pyx_t_1;
14419 0 : Py_ssize_t *__pyx_t_2;
14420 0 : long __pyx_t_3;
14421 0 : long __pyx_t_4;
14422 0 : Py_ssize_t __pyx_t_5;
14423 0 : Py_ssize_t __pyx_t_6;
14424 0 : int __pyx_t_7;
14425 0 : int __pyx_t_8;
14426 0 : int __pyx_t_9;
14427 0 : int __pyx_lineno = 0;
14428 0 : const char *__pyx_filename = NULL;
14429 0 : int __pyx_clineno = 0;
14430 : #ifdef WITH_THREAD
14431 0 : PyGILState_STATE __pyx_gilstate_save;
14432 : #endif
14433 :
14434 : /* "View.MemoryView":930
14435 : * @cname('__pyx_memslice_transpose')
14436 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14437 : * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14438 : *
14439 : * cdef Py_ssize_t *shape = memslice.shape
14440 : */
14441 0 : __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14442 0 : __pyx_v_ndim = __pyx_t_1;
14443 :
14444 : /* "View.MemoryView":932
14445 : * cdef int ndim = memslice.memview.view.ndim
14446 : *
14447 : * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14448 : * cdef Py_ssize_t *strides = memslice.strides
14449 : *
14450 : */
14451 0 : __pyx_t_2 = __pyx_v_memslice->shape;
14452 0 : __pyx_v_shape = __pyx_t_2;
14453 :
14454 : /* "View.MemoryView":933
14455 : *
14456 : * cdef Py_ssize_t *shape = memslice.shape
14457 : * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14458 : *
14459 : *
14460 : */
14461 0 : __pyx_t_2 = __pyx_v_memslice->strides;
14462 0 : __pyx_v_strides = __pyx_t_2;
14463 :
14464 : /* "View.MemoryView":937
14465 : *
14466 : * cdef int i, j
14467 : * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14468 : * j = ndim - 1 - i
14469 : * strides[i], strides[j] = strides[j], strides[i]
14470 : */
14471 0 : __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
14472 0 : __pyx_t_4 = __pyx_t_3;
14473 0 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14474 0 : __pyx_v_i = __pyx_t_1;
14475 :
14476 : /* "View.MemoryView":938
14477 : * cdef int i, j
14478 : * for i in range(ndim // 2):
14479 : * j = ndim - 1 - i # <<<<<<<<<<<<<<
14480 : * strides[i], strides[j] = strides[j], strides[i]
14481 : * shape[i], shape[j] = shape[j], shape[i]
14482 : */
14483 0 : __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14484 :
14485 : /* "View.MemoryView":939
14486 : * for i in range(ndim // 2):
14487 : * j = ndim - 1 - i
14488 : * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14489 : * shape[i], shape[j] = shape[j], shape[i]
14490 : *
14491 : */
14492 0 : __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14493 0 : __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14494 0 : (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14495 0 : (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14496 :
14497 : /* "View.MemoryView":940
14498 : * j = ndim - 1 - i
14499 : * strides[i], strides[j] = strides[j], strides[i]
14500 : * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14501 : *
14502 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14503 : */
14504 0 : __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14505 0 : __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14506 0 : (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14507 0 : (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14508 :
14509 : /* "View.MemoryView":942
14510 : * shape[i], shape[j] = shape[j], shape[i]
14511 : *
14512 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14513 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14514 : *
14515 : */
14516 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14517 0 : if (!__pyx_t_8) {
14518 0 : } else {
14519 0 : __pyx_t_7 = __pyx_t_8;
14520 0 : goto __pyx_L6_bool_binop_done;
14521 : }
14522 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14523 0 : __pyx_t_7 = __pyx_t_8;
14524 0 : __pyx_L6_bool_binop_done:;
14525 0 : if (__pyx_t_7) {
14526 :
14527 : /* "View.MemoryView":943
14528 : *
14529 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14530 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14531 : *
14532 : * return 0
14533 : */
14534 0 : __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
14535 :
14536 : /* "View.MemoryView":942
14537 : * shape[i], shape[j] = shape[j], shape[i]
14538 : *
14539 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14540 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14541 : *
14542 : */
14543 : }
14544 : }
14545 :
14546 : /* "View.MemoryView":945
14547 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14548 : *
14549 : * return 0 # <<<<<<<<<<<<<<
14550 : *
14551 : *
14552 : */
14553 0 : __pyx_r = 0;
14554 0 : goto __pyx_L0;
14555 :
14556 : /* "View.MemoryView":929
14557 : *
14558 : * @cname('__pyx_memslice_transpose')
14559 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14560 : * cdef int ndim = memslice.memview.view.ndim
14561 : *
14562 : */
14563 :
14564 : /* function exit code */
14565 0 : __pyx_L1_error:;
14566 : #ifdef WITH_THREAD
14567 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14568 : #endif
14569 0 : __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14570 0 : __pyx_r = -1;
14571 : #ifdef WITH_THREAD
14572 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14573 : #endif
14574 0 : __pyx_L0:;
14575 0 : return __pyx_r;
14576 : }
14577 :
14578 : /* "View.MemoryView":963
14579 : * cdef int (*to_dtype_func)(char *, object) except 0
14580 : *
14581 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14582 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14583 : *
14584 : */
14585 :
14586 : /* Python wrapper */
14587 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14588 29 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14589 29 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14590 : __Pyx_RefNannyDeclarations
14591 29 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14592 29 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14593 58 : __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14594 :
14595 : /* function exit code */
14596 29 : __Pyx_RefNannyFinishContext();
14597 : }
14598 :
14599 29 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14600 :
14601 : /* "View.MemoryView":964
14602 : *
14603 : * def __dealloc__(self):
14604 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14605 : *
14606 : * cdef convert_item_to_object(self, char *itemp):
14607 : */
14608 29 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14609 :
14610 : /* "View.MemoryView":963
14611 : * cdef int (*to_dtype_func)(char *, object) except 0
14612 : *
14613 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14614 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14615 : *
14616 : */
14617 :
14618 : /* function exit code */
14619 : }
14620 :
14621 : /* "View.MemoryView":966
14622 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14623 : *
14624 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14625 : * if self.to_object_func != NULL:
14626 : * return self.to_object_func(itemp)
14627 : */
14628 :
14629 0 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14630 0 : PyObject *__pyx_r = NULL;
14631 : __Pyx_RefNannyDeclarations
14632 0 : int __pyx_t_1;
14633 0 : PyObject *__pyx_t_2 = NULL;
14634 0 : int __pyx_lineno = 0;
14635 0 : const char *__pyx_filename = NULL;
14636 0 : int __pyx_clineno = 0;
14637 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
14638 :
14639 : /* "View.MemoryView":967
14640 : *
14641 : * cdef convert_item_to_object(self, char *itemp):
14642 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14643 : * return self.to_object_func(itemp)
14644 : * else:
14645 : */
14646 0 : __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14647 0 : if (__pyx_t_1) {
14648 :
14649 : /* "View.MemoryView":968
14650 : * cdef convert_item_to_object(self, char *itemp):
14651 : * if self.to_object_func != NULL:
14652 : * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14653 : * else:
14654 : * return memoryview.convert_item_to_object(self, itemp)
14655 : */
14656 0 : __Pyx_XDECREF(__pyx_r);
14657 0 : __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
14658 0 : __Pyx_GOTREF(__pyx_t_2);
14659 0 : __pyx_r = __pyx_t_2;
14660 0 : __pyx_t_2 = 0;
14661 0 : goto __pyx_L0;
14662 :
14663 : /* "View.MemoryView":967
14664 : *
14665 : * cdef convert_item_to_object(self, char *itemp):
14666 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14667 : * return self.to_object_func(itemp)
14668 : * else:
14669 : */
14670 : }
14671 :
14672 : /* "View.MemoryView":970
14673 : * return self.to_object_func(itemp)
14674 : * else:
14675 : * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14676 : *
14677 : * cdef assign_item_from_object(self, char *itemp, object value):
14678 : */
14679 : /*else*/ {
14680 0 : __Pyx_XDECREF(__pyx_r);
14681 0 : __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
14682 0 : __Pyx_GOTREF(__pyx_t_2);
14683 0 : __pyx_r = __pyx_t_2;
14684 0 : __pyx_t_2 = 0;
14685 0 : goto __pyx_L0;
14686 : }
14687 :
14688 : /* "View.MemoryView":966
14689 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14690 : *
14691 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14692 : * if self.to_object_func != NULL:
14693 : * return self.to_object_func(itemp)
14694 : */
14695 :
14696 : /* function exit code */
14697 0 : __pyx_L1_error:;
14698 0 : __Pyx_XDECREF(__pyx_t_2);
14699 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14700 0 : __pyx_r = 0;
14701 0 : __pyx_L0:;
14702 0 : __Pyx_XGIVEREF(__pyx_r);
14703 0 : __Pyx_RefNannyFinishContext();
14704 0 : return __pyx_r;
14705 : }
14706 :
14707 : /* "View.MemoryView":972
14708 : * return memoryview.convert_item_to_object(self, itemp)
14709 : *
14710 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14711 : * if self.to_dtype_func != NULL:
14712 : * self.to_dtype_func(itemp, value)
14713 : */
14714 :
14715 0 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14716 0 : PyObject *__pyx_r = NULL;
14717 : __Pyx_RefNannyDeclarations
14718 0 : int __pyx_t_1;
14719 0 : int __pyx_t_2;
14720 0 : PyObject *__pyx_t_3 = NULL;
14721 0 : int __pyx_lineno = 0;
14722 0 : const char *__pyx_filename = NULL;
14723 0 : int __pyx_clineno = 0;
14724 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
14725 :
14726 : /* "View.MemoryView":973
14727 : *
14728 : * cdef assign_item_from_object(self, char *itemp, object value):
14729 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14730 : * self.to_dtype_func(itemp, value)
14731 : * else:
14732 : */
14733 0 : __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14734 0 : if (__pyx_t_1) {
14735 :
14736 : /* "View.MemoryView":974
14737 : * cdef assign_item_from_object(self, char *itemp, object value):
14738 : * if self.to_dtype_func != NULL:
14739 : * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14740 : * else:
14741 : * memoryview.assign_item_from_object(self, itemp, value)
14742 : */
14743 0 : __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
14744 :
14745 : /* "View.MemoryView":973
14746 : *
14747 : * cdef assign_item_from_object(self, char *itemp, object value):
14748 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14749 : * self.to_dtype_func(itemp, value)
14750 : * else:
14751 : */
14752 0 : goto __pyx_L3;
14753 : }
14754 :
14755 : /* "View.MemoryView":976
14756 : * self.to_dtype_func(itemp, value)
14757 : * else:
14758 : * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14759 : *
14760 : * cdef _get_base(self):
14761 : */
14762 : /*else*/ {
14763 0 : __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
14764 0 : __Pyx_GOTREF(__pyx_t_3);
14765 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14766 : }
14767 0 : __pyx_L3:;
14768 :
14769 : /* "View.MemoryView":972
14770 : * return memoryview.convert_item_to_object(self, itemp)
14771 : *
14772 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14773 : * if self.to_dtype_func != NULL:
14774 : * self.to_dtype_func(itemp, value)
14775 : */
14776 :
14777 : /* function exit code */
14778 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14779 0 : goto __pyx_L0;
14780 0 : __pyx_L1_error:;
14781 0 : __Pyx_XDECREF(__pyx_t_3);
14782 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14783 0 : __pyx_r = 0;
14784 0 : __pyx_L0:;
14785 0 : __Pyx_XGIVEREF(__pyx_r);
14786 0 : __Pyx_RefNannyFinishContext();
14787 0 : return __pyx_r;
14788 : }
14789 :
14790 : /* "View.MemoryView":978
14791 : * memoryview.assign_item_from_object(self, itemp, value)
14792 : *
14793 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14794 : * return self.from_object
14795 : *
14796 : */
14797 :
14798 0 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14799 0 : PyObject *__pyx_r = NULL;
14800 : __Pyx_RefNannyDeclarations
14801 0 : __Pyx_RefNannySetupContext("_get_base", 1);
14802 :
14803 : /* "View.MemoryView":979
14804 : *
14805 : * cdef _get_base(self):
14806 : * return self.from_object # <<<<<<<<<<<<<<
14807 : *
14808 : *
14809 : */
14810 0 : __Pyx_XDECREF(__pyx_r);
14811 0 : __Pyx_INCREF(__pyx_v_self->from_object);
14812 0 : __pyx_r = __pyx_v_self->from_object;
14813 0 : goto __pyx_L0;
14814 :
14815 : /* "View.MemoryView":978
14816 : * memoryview.assign_item_from_object(self, itemp, value)
14817 : *
14818 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14819 : * return self.from_object
14820 : *
14821 : */
14822 :
14823 : /* function exit code */
14824 0 : __pyx_L0:;
14825 0 : __Pyx_XGIVEREF(__pyx_r);
14826 0 : __Pyx_RefNannyFinishContext();
14827 0 : return __pyx_r;
14828 : }
14829 :
14830 : /* "(tree fragment)":1
14831 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14832 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14833 : * def __setstate_cython__(self, __pyx_state):
14834 : */
14835 :
14836 : /* Python wrapper */
14837 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14838 : #if CYTHON_METH_FASTCALL
14839 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14840 : #else
14841 : PyObject *__pyx_args, PyObject *__pyx_kwds
14842 : #endif
14843 : ); /*proto*/
14844 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14845 : #if CYTHON_METH_FASTCALL
14846 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14847 : #else
14848 : PyObject *__pyx_args, PyObject *__pyx_kwds
14849 : #endif
14850 : ) {
14851 : #if !CYTHON_METH_FASTCALL
14852 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14853 : #endif
14854 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14855 0 : PyObject *__pyx_r = 0;
14856 : __Pyx_RefNannyDeclarations
14857 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14858 : #if !CYTHON_METH_FASTCALL
14859 : #if CYTHON_ASSUME_SAFE_MACROS
14860 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14861 : #else
14862 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14863 : #endif
14864 : #endif
14865 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14866 0 : if (unlikely(__pyx_nargs > 0)) {
14867 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
14868 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
14869 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14870 :
14871 : /* function exit code */
14872 0 : __Pyx_RefNannyFinishContext();
14873 0 : return __pyx_r;
14874 : }
14875 :
14876 0 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14877 0 : PyObject *__pyx_r = NULL;
14878 : __Pyx_RefNannyDeclarations
14879 0 : int __pyx_lineno = 0;
14880 0 : const char *__pyx_filename = NULL;
14881 0 : int __pyx_clineno = 0;
14882 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
14883 :
14884 : /* "(tree fragment)":2
14885 : * def __reduce_cython__(self):
14886 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14887 : * def __setstate_cython__(self, __pyx_state):
14888 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14889 : */
14890 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
14891 0 : __PYX_ERR(1, 2, __pyx_L1_error)
14892 :
14893 : /* "(tree fragment)":1
14894 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14895 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14896 : * def __setstate_cython__(self, __pyx_state):
14897 : */
14898 :
14899 : /* function exit code */
14900 0 : __pyx_L1_error:;
14901 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14902 0 : __pyx_r = NULL;
14903 0 : __Pyx_XGIVEREF(__pyx_r);
14904 0 : __Pyx_RefNannyFinishContext();
14905 0 : return __pyx_r;
14906 : }
14907 :
14908 : /* "(tree fragment)":3
14909 : * def __reduce_cython__(self):
14910 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14911 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14912 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14913 : */
14914 :
14915 : /* Python wrapper */
14916 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14917 : #if CYTHON_METH_FASTCALL
14918 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14919 : #else
14920 : PyObject *__pyx_args, PyObject *__pyx_kwds
14921 : #endif
14922 : ); /*proto*/
14923 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14924 : #if CYTHON_METH_FASTCALL
14925 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14926 : #else
14927 : PyObject *__pyx_args, PyObject *__pyx_kwds
14928 : #endif
14929 : ) {
14930 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
14931 : #if !CYTHON_METH_FASTCALL
14932 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14933 : #endif
14934 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14935 0 : PyObject* values[1] = {0};
14936 0 : int __pyx_lineno = 0;
14937 0 : const char *__pyx_filename = NULL;
14938 0 : int __pyx_clineno = 0;
14939 0 : PyObject *__pyx_r = 0;
14940 : __Pyx_RefNannyDeclarations
14941 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14942 : #if !CYTHON_METH_FASTCALL
14943 : #if CYTHON_ASSUME_SAFE_MACROS
14944 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14945 : #else
14946 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14947 : #endif
14948 : #endif
14949 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14950 : {
14951 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
14952 0 : if (__pyx_kwds) {
14953 0 : Py_ssize_t kw_args;
14954 0 : switch (__pyx_nargs) {
14955 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14956 0 : CYTHON_FALLTHROUGH;
14957 0 : case 0: break;
14958 0 : default: goto __pyx_L5_argtuple_error;
14959 : }
14960 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
14961 0 : switch (__pyx_nargs) {
14962 : case 0:
14963 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
14964 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
14965 0 : kw_args--;
14966 : }
14967 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
14968 0 : else goto __pyx_L5_argtuple_error;
14969 : }
14970 0 : if (unlikely(kw_args > 0)) {
14971 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
14972 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
14973 : }
14974 0 : } else if (unlikely(__pyx_nargs != 1)) {
14975 0 : goto __pyx_L5_argtuple_error;
14976 : } else {
14977 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14978 : }
14979 0 : __pyx_v___pyx_state = values[0];
14980 : }
14981 0 : goto __pyx_L6_skip;
14982 0 : __pyx_L5_argtuple_error:;
14983 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
14984 0 : __pyx_L6_skip:;
14985 0 : goto __pyx_L4_argument_unpacking_done;
14986 0 : __pyx_L3_error:;
14987 : {
14988 0 : Py_ssize_t __pyx_temp;
14989 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14990 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
14991 : }
14992 : }
14993 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14994 0 : __Pyx_RefNannyFinishContext();
14995 0 : return NULL;
14996 0 : __pyx_L4_argument_unpacking_done:;
14997 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
14998 :
14999 : /* function exit code */
15000 : {
15001 0 : Py_ssize_t __pyx_temp;
15002 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15003 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
15004 : }
15005 : }
15006 : __Pyx_RefNannyFinishContext();
15007 : return __pyx_r;
15008 : }
15009 :
15010 0 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15011 0 : PyObject *__pyx_r = NULL;
15012 : __Pyx_RefNannyDeclarations
15013 0 : int __pyx_lineno = 0;
15014 0 : const char *__pyx_filename = NULL;
15015 0 : int __pyx_clineno = 0;
15016 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
15017 :
15018 : /* "(tree fragment)":4
15019 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15020 : * def __setstate_cython__(self, __pyx_state):
15021 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15022 : */
15023 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
15024 0 : __PYX_ERR(1, 4, __pyx_L1_error)
15025 :
15026 : /* "(tree fragment)":3
15027 : * def __reduce_cython__(self):
15028 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15029 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15030 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15031 : */
15032 :
15033 : /* function exit code */
15034 0 : __pyx_L1_error:;
15035 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15036 0 : __pyx_r = NULL;
15037 0 : __Pyx_XGIVEREF(__pyx_r);
15038 0 : __Pyx_RefNannyFinishContext();
15039 0 : return __pyx_r;
15040 : }
15041 :
15042 : /* "View.MemoryView":999
15043 : *
15044 : * @cname('__pyx_memoryview_fromslice')
15045 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15046 : * int ndim,
15047 : * object (*to_object_func)(char *),
15048 : */
15049 :
15050 29 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
15051 29 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15052 29 : Py_ssize_t __pyx_v_suboffset;
15053 29 : PyObject *__pyx_v_length = NULL;
15054 29 : PyObject *__pyx_r = NULL;
15055 : __Pyx_RefNannyDeclarations
15056 29 : int __pyx_t_1;
15057 29 : PyObject *__pyx_t_2 = NULL;
15058 29 : PyObject *__pyx_t_3 = NULL;
15059 29 : __Pyx_TypeInfo *__pyx_t_4;
15060 29 : Py_buffer __pyx_t_5;
15061 29 : Py_ssize_t *__pyx_t_6;
15062 29 : Py_ssize_t *__pyx_t_7;
15063 29 : Py_ssize_t *__pyx_t_8;
15064 29 : Py_ssize_t __pyx_t_9;
15065 29 : int __pyx_lineno = 0;
15066 29 : const char *__pyx_filename = NULL;
15067 29 : int __pyx_clineno = 0;
15068 29 : __Pyx_RefNannySetupContext("memoryview_fromslice", 1);
15069 :
15070 : /* "View.MemoryView":1007
15071 : * cdef _memoryviewslice result
15072 : *
15073 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15074 : * return None
15075 : *
15076 : */
15077 29 : __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15078 29 : if (__pyx_t_1) {
15079 :
15080 : /* "View.MemoryView":1008
15081 : *
15082 : * if <PyObject *> memviewslice.memview == Py_None:
15083 : * return None # <<<<<<<<<<<<<<
15084 : *
15085 : *
15086 : */
15087 0 : __Pyx_XDECREF(__pyx_r);
15088 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15089 0 : goto __pyx_L0;
15090 :
15091 : /* "View.MemoryView":1007
15092 : * cdef _memoryviewslice result
15093 : *
15094 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15095 : * return None
15096 : *
15097 : */
15098 : }
15099 :
15100 : /* "View.MemoryView":1013
15101 : *
15102 : *
15103 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15104 : *
15105 : * result.from_slice = memviewslice
15106 : */
15107 29 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15108 29 : __Pyx_GOTREF(__pyx_t_2);
15109 29 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
15110 29 : __Pyx_GOTREF(__pyx_t_3);
15111 29 : __Pyx_INCREF(Py_None);
15112 29 : __Pyx_GIVEREF(Py_None);
15113 29 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(1, 1013, __pyx_L1_error);
15114 29 : __Pyx_INCREF(__pyx_int_0);
15115 29 : __Pyx_GIVEREF(__pyx_int_0);
15116 29 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(1, 1013, __pyx_L1_error);
15117 29 : __Pyx_GIVEREF(__pyx_t_2);
15118 29 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error);
15119 29 : __pyx_t_2 = 0;
15120 29 : __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15121 29 : __Pyx_GOTREF((PyObject *)__pyx_t_2);
15122 29 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15123 29 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15124 29 : __pyx_t_2 = 0;
15125 :
15126 : /* "View.MemoryView":1015
15127 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
15128 : *
15129 : * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15130 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15131 : *
15132 : */
15133 29 : __pyx_v_result->from_slice = __pyx_v_memviewslice;
15134 :
15135 : /* "View.MemoryView":1016
15136 : *
15137 : * result.from_slice = memviewslice
15138 : * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15139 : *
15140 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15141 : */
15142 29 : __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15143 :
15144 : /* "View.MemoryView":1018
15145 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15146 : *
15147 : * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15148 : * result.typeinfo = memviewslice.memview.typeinfo
15149 : *
15150 : */
15151 29 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
15152 29 : __Pyx_GOTREF(__pyx_t_2);
15153 29 : __Pyx_GIVEREF(__pyx_t_2);
15154 29 : __Pyx_GOTREF(__pyx_v_result->from_object);
15155 29 : __Pyx_DECREF(__pyx_v_result->from_object);
15156 29 : __pyx_v_result->from_object = __pyx_t_2;
15157 29 : __pyx_t_2 = 0;
15158 :
15159 : /* "View.MemoryView":1019
15160 : *
15161 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15162 : * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15163 : *
15164 : * result.view = memviewslice.memview.view
15165 : */
15166 29 : __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15167 29 : __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15168 :
15169 : /* "View.MemoryView":1021
15170 : * result.typeinfo = memviewslice.memview.typeinfo
15171 : *
15172 : * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15173 : * result.view.buf = <void *> memviewslice.data
15174 : * result.view.ndim = ndim
15175 : */
15176 29 : __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15177 29 : __pyx_v_result->__pyx_base.view = __pyx_t_5;
15178 :
15179 : /* "View.MemoryView":1022
15180 : *
15181 : * result.view = memviewslice.memview.view
15182 : * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15183 : * result.view.ndim = ndim
15184 : * (<__pyx_buffer *> &result.view).obj = Py_None
15185 : */
15186 29 : __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15187 :
15188 : /* "View.MemoryView":1023
15189 : * result.view = memviewslice.memview.view
15190 : * result.view.buf = <void *> memviewslice.data
15191 : * result.view.ndim = ndim # <<<<<<<<<<<<<<
15192 : * (<__pyx_buffer *> &result.view).obj = Py_None
15193 : * Py_INCREF(Py_None)
15194 : */
15195 29 : __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15196 :
15197 : /* "View.MemoryView":1024
15198 : * result.view.buf = <void *> memviewslice.data
15199 : * result.view.ndim = ndim
15200 : * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15201 : * Py_INCREF(Py_None)
15202 : *
15203 : */
15204 29 : ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15205 :
15206 : /* "View.MemoryView":1025
15207 : * result.view.ndim = ndim
15208 : * (<__pyx_buffer *> &result.view).obj = Py_None
15209 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15210 : *
15211 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15212 : */
15213 29 : Py_INCREF(Py_None);
15214 :
15215 : /* "View.MemoryView":1027
15216 : * Py_INCREF(Py_None)
15217 : *
15218 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15219 : * result.flags = PyBUF_RECORDS
15220 : * else:
15221 : */
15222 29 : __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15223 29 : if (__pyx_t_1) {
15224 :
15225 : /* "View.MemoryView":1028
15226 : *
15227 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15228 : * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15229 : * else:
15230 : * result.flags = PyBUF_RECORDS_RO
15231 : */
15232 29 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15233 :
15234 : /* "View.MemoryView":1027
15235 : * Py_INCREF(Py_None)
15236 : *
15237 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15238 : * result.flags = PyBUF_RECORDS
15239 : * else:
15240 : */
15241 29 : goto __pyx_L4;
15242 : }
15243 :
15244 : /* "View.MemoryView":1030
15245 : * result.flags = PyBUF_RECORDS
15246 : * else:
15247 : * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15248 : *
15249 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15250 : */
15251 : /*else*/ {
15252 0 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15253 : }
15254 29 : __pyx_L4:;
15255 :
15256 : /* "View.MemoryView":1032
15257 : * result.flags = PyBUF_RECORDS_RO
15258 : *
15259 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15260 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15261 : *
15262 : */
15263 29 : __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15264 :
15265 : /* "View.MemoryView":1033
15266 : *
15267 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15268 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15269 : *
15270 : *
15271 : */
15272 29 : __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15273 :
15274 : /* "View.MemoryView":1036
15275 : *
15276 : *
15277 : * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15278 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15279 : * if suboffset >= 0:
15280 : */
15281 29 : __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15282 :
15283 : /* "View.MemoryView":1037
15284 : *
15285 : * result.view.suboffsets = NULL
15286 : * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15287 : * if suboffset >= 0:
15288 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15289 : */
15290 29 : __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15291 58 : for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15292 29 : __pyx_t_6 = __pyx_t_8;
15293 29 : __pyx_v_suboffset = (__pyx_t_6[0]);
15294 :
15295 : /* "View.MemoryView":1038
15296 : * result.view.suboffsets = NULL
15297 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15298 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15299 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15300 : * break
15301 : */
15302 29 : __pyx_t_1 = (__pyx_v_suboffset >= 0);
15303 29 : if (__pyx_t_1) {
15304 :
15305 : /* "View.MemoryView":1039
15306 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15307 : * if suboffset >= 0:
15308 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15309 : * break
15310 : *
15311 : */
15312 0 : __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15313 :
15314 : /* "View.MemoryView":1040
15315 : * if suboffset >= 0:
15316 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15317 : * break # <<<<<<<<<<<<<<
15318 : *
15319 : * result.view.len = result.view.itemsize
15320 : */
15321 0 : goto __pyx_L6_break;
15322 :
15323 : /* "View.MemoryView":1038
15324 : * result.view.suboffsets = NULL
15325 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15326 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15327 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15328 : * break
15329 : */
15330 : }
15331 : }
15332 29 : __pyx_L6_break:;
15333 :
15334 : /* "View.MemoryView":1042
15335 : * break
15336 : *
15337 : * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15338 : * for length in result.view.shape[:ndim]:
15339 : * result.view.len *= length
15340 : */
15341 29 : __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15342 29 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15343 :
15344 : /* "View.MemoryView":1043
15345 : *
15346 : * result.view.len = result.view.itemsize
15347 : * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15348 : * result.view.len *= length
15349 : *
15350 : */
15351 29 : __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15352 58 : for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15353 29 : __pyx_t_6 = __pyx_t_8;
15354 29 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
15355 29 : __Pyx_GOTREF(__pyx_t_2);
15356 29 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15357 29 : __pyx_t_2 = 0;
15358 :
15359 : /* "View.MemoryView":1044
15360 : * result.view.len = result.view.itemsize
15361 : * for length in result.view.shape[:ndim]:
15362 : * result.view.len *= length # <<<<<<<<<<<<<<
15363 : *
15364 : * result.to_object_func = to_object_func
15365 : */
15366 29 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
15367 29 : __Pyx_GOTREF(__pyx_t_2);
15368 29 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
15369 29 : __Pyx_GOTREF(__pyx_t_3);
15370 29 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15371 29 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
15372 29 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15373 29 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15374 : }
15375 :
15376 : /* "View.MemoryView":1046
15377 : * result.view.len *= length
15378 : *
15379 : * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15380 : * result.to_dtype_func = to_dtype_func
15381 : *
15382 : */
15383 29 : __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15384 :
15385 : /* "View.MemoryView":1047
15386 : *
15387 : * result.to_object_func = to_object_func
15388 : * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15389 : *
15390 : * return result
15391 : */
15392 29 : __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15393 :
15394 : /* "View.MemoryView":1049
15395 : * result.to_dtype_func = to_dtype_func
15396 : *
15397 : * return result # <<<<<<<<<<<<<<
15398 : *
15399 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15400 : */
15401 29 : __Pyx_XDECREF(__pyx_r);
15402 29 : __Pyx_INCREF((PyObject *)__pyx_v_result);
15403 29 : __pyx_r = ((PyObject *)__pyx_v_result);
15404 29 : goto __pyx_L0;
15405 :
15406 : /* "View.MemoryView":999
15407 : *
15408 : * @cname('__pyx_memoryview_fromslice')
15409 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15410 : * int ndim,
15411 : * object (*to_object_func)(char *),
15412 : */
15413 :
15414 : /* function exit code */
15415 0 : __pyx_L1_error:;
15416 0 : __Pyx_XDECREF(__pyx_t_2);
15417 0 : __Pyx_XDECREF(__pyx_t_3);
15418 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15419 0 : __pyx_r = 0;
15420 29 : __pyx_L0:;
15421 29 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
15422 29 : __Pyx_XDECREF(__pyx_v_length);
15423 29 : __Pyx_XGIVEREF(__pyx_r);
15424 29 : __Pyx_RefNannyFinishContext();
15425 29 : return __pyx_r;
15426 : }
15427 :
15428 : /* "View.MemoryView":1052
15429 : *
15430 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15431 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15432 : * __Pyx_memviewslice *mslice) except NULL:
15433 : * cdef _memoryviewslice obj
15434 : */
15435 :
15436 0 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15437 0 : struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15438 0 : __Pyx_memviewslice *__pyx_r;
15439 : __Pyx_RefNannyDeclarations
15440 0 : int __pyx_t_1;
15441 0 : PyObject *__pyx_t_2 = NULL;
15442 0 : int __pyx_lineno = 0;
15443 0 : const char *__pyx_filename = NULL;
15444 0 : int __pyx_clineno = 0;
15445 0 : __Pyx_RefNannySetupContext("get_slice_from_memview", 1);
15446 :
15447 : /* "View.MemoryView":1055
15448 : * __Pyx_memviewslice *mslice) except NULL:
15449 : * cdef _memoryviewslice obj
15450 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15451 : * obj = memview
15452 : * return &obj.from_slice
15453 : */
15454 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15455 0 : if (__pyx_t_1) {
15456 :
15457 : /* "View.MemoryView":1056
15458 : * cdef _memoryviewslice obj
15459 : * if isinstance(memview, _memoryviewslice):
15460 : * obj = memview # <<<<<<<<<<<<<<
15461 : * return &obj.from_slice
15462 : * else:
15463 : */
15464 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
15465 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15466 0 : __Pyx_INCREF(__pyx_t_2);
15467 0 : __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15468 0 : __pyx_t_2 = 0;
15469 :
15470 : /* "View.MemoryView":1057
15471 : * if isinstance(memview, _memoryviewslice):
15472 : * obj = memview
15473 : * return &obj.from_slice # <<<<<<<<<<<<<<
15474 : * else:
15475 : * slice_copy(memview, mslice)
15476 : */
15477 0 : __pyx_r = (&__pyx_v_obj->from_slice);
15478 0 : goto __pyx_L0;
15479 :
15480 : /* "View.MemoryView":1055
15481 : * __Pyx_memviewslice *mslice) except NULL:
15482 : * cdef _memoryviewslice obj
15483 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15484 : * obj = memview
15485 : * return &obj.from_slice
15486 : */
15487 : }
15488 :
15489 : /* "View.MemoryView":1059
15490 : * return &obj.from_slice
15491 : * else:
15492 : * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15493 : * return mslice
15494 : *
15495 : */
15496 : /*else*/ {
15497 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15498 :
15499 : /* "View.MemoryView":1060
15500 : * else:
15501 : * slice_copy(memview, mslice)
15502 : * return mslice # <<<<<<<<<<<<<<
15503 : *
15504 : * @cname('__pyx_memoryview_slice_copy')
15505 : */
15506 0 : __pyx_r = __pyx_v_mslice;
15507 0 : goto __pyx_L0;
15508 : }
15509 :
15510 : /* "View.MemoryView":1052
15511 : *
15512 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15513 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15514 : * __Pyx_memviewslice *mslice) except NULL:
15515 : * cdef _memoryviewslice obj
15516 : */
15517 :
15518 : /* function exit code */
15519 0 : __pyx_L1_error:;
15520 0 : __Pyx_XDECREF(__pyx_t_2);
15521 0 : __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15522 0 : __pyx_r = NULL;
15523 0 : __pyx_L0:;
15524 0 : __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15525 0 : __Pyx_RefNannyFinishContext();
15526 0 : return __pyx_r;
15527 : }
15528 :
15529 : /* "View.MemoryView":1063
15530 : *
15531 : * @cname('__pyx_memoryview_slice_copy')
15532 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15533 : * cdef int dim
15534 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15535 : */
15536 :
15537 0 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15538 0 : int __pyx_v_dim;
15539 0 : Py_ssize_t *__pyx_v_shape;
15540 0 : Py_ssize_t *__pyx_v_strides;
15541 0 : Py_ssize_t *__pyx_v_suboffsets;
15542 0 : Py_ssize_t *__pyx_t_1;
15543 0 : int __pyx_t_2;
15544 0 : int __pyx_t_3;
15545 0 : int __pyx_t_4;
15546 0 : Py_ssize_t __pyx_t_5;
15547 0 : int __pyx_t_6;
15548 :
15549 : /* "View.MemoryView":1067
15550 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15551 : *
15552 : * shape = memview.view.shape # <<<<<<<<<<<<<<
15553 : * strides = memview.view.strides
15554 : * suboffsets = memview.view.suboffsets
15555 : */
15556 0 : __pyx_t_1 = __pyx_v_memview->view.shape;
15557 0 : __pyx_v_shape = __pyx_t_1;
15558 :
15559 : /* "View.MemoryView":1068
15560 : *
15561 : * shape = memview.view.shape
15562 : * strides = memview.view.strides # <<<<<<<<<<<<<<
15563 : * suboffsets = memview.view.suboffsets
15564 : *
15565 : */
15566 0 : __pyx_t_1 = __pyx_v_memview->view.strides;
15567 0 : __pyx_v_strides = __pyx_t_1;
15568 :
15569 : /* "View.MemoryView":1069
15570 : * shape = memview.view.shape
15571 : * strides = memview.view.strides
15572 : * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15573 : *
15574 : * dst.memview = <__pyx_memoryview *> memview
15575 : */
15576 0 : __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15577 0 : __pyx_v_suboffsets = __pyx_t_1;
15578 :
15579 : /* "View.MemoryView":1071
15580 : * suboffsets = memview.view.suboffsets
15581 : *
15582 : * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15583 : * dst.data = <char *> memview.view.buf
15584 : *
15585 : */
15586 0 : __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15587 :
15588 : /* "View.MemoryView":1072
15589 : *
15590 : * dst.memview = <__pyx_memoryview *> memview
15591 : * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15592 : *
15593 : * for dim in range(memview.view.ndim):
15594 : */
15595 0 : __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15596 :
15597 : /* "View.MemoryView":1074
15598 : * dst.data = <char *> memview.view.buf
15599 : *
15600 : * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15601 : * dst.shape[dim] = shape[dim]
15602 : * dst.strides[dim] = strides[dim]
15603 : */
15604 0 : __pyx_t_2 = __pyx_v_memview->view.ndim;
15605 0 : __pyx_t_3 = __pyx_t_2;
15606 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15607 0 : __pyx_v_dim = __pyx_t_4;
15608 :
15609 : /* "View.MemoryView":1075
15610 : *
15611 : * for dim in range(memview.view.ndim):
15612 : * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15613 : * dst.strides[dim] = strides[dim]
15614 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15615 : */
15616 0 : (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15617 :
15618 : /* "View.MemoryView":1076
15619 : * for dim in range(memview.view.ndim):
15620 : * dst.shape[dim] = shape[dim]
15621 : * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15622 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15623 : *
15624 : */
15625 0 : (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15626 :
15627 : /* "View.MemoryView":1077
15628 : * dst.shape[dim] = shape[dim]
15629 : * dst.strides[dim] = strides[dim]
15630 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15631 : *
15632 : * @cname('__pyx_memoryview_copy_object')
15633 : */
15634 0 : __pyx_t_6 = (__pyx_v_suboffsets != 0);
15635 0 : if (__pyx_t_6) {
15636 0 : __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15637 : } else {
15638 : __pyx_t_5 = -1L;
15639 : }
15640 0 : (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15641 : }
15642 :
15643 : /* "View.MemoryView":1063
15644 : *
15645 : * @cname('__pyx_memoryview_slice_copy')
15646 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15647 : * cdef int dim
15648 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15649 : */
15650 :
15651 : /* function exit code */
15652 0 : }
15653 :
15654 : /* "View.MemoryView":1080
15655 : *
15656 : * @cname('__pyx_memoryview_copy_object')
15657 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15658 : * "Create a new memoryview object"
15659 : * cdef __Pyx_memviewslice memviewslice
15660 : */
15661 :
15662 0 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15663 0 : __Pyx_memviewslice __pyx_v_memviewslice;
15664 0 : PyObject *__pyx_r = NULL;
15665 : __Pyx_RefNannyDeclarations
15666 0 : PyObject *__pyx_t_1 = NULL;
15667 0 : int __pyx_lineno = 0;
15668 0 : const char *__pyx_filename = NULL;
15669 0 : int __pyx_clineno = 0;
15670 0 : __Pyx_RefNannySetupContext("memoryview_copy", 1);
15671 :
15672 : /* "View.MemoryView":1083
15673 : * "Create a new memoryview object"
15674 : * cdef __Pyx_memviewslice memviewslice
15675 : * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15676 : * return memoryview_copy_from_slice(memview, &memviewslice)
15677 : *
15678 : */
15679 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15680 :
15681 : /* "View.MemoryView":1084
15682 : * cdef __Pyx_memviewslice memviewslice
15683 : * slice_copy(memview, &memviewslice)
15684 : * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15685 : *
15686 : * @cname('__pyx_memoryview_copy_object_from_slice')
15687 : */
15688 0 : __Pyx_XDECREF(__pyx_r);
15689 0 : __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
15690 0 : __Pyx_GOTREF(__pyx_t_1);
15691 0 : __pyx_r = __pyx_t_1;
15692 0 : __pyx_t_1 = 0;
15693 0 : goto __pyx_L0;
15694 :
15695 : /* "View.MemoryView":1080
15696 : *
15697 : * @cname('__pyx_memoryview_copy_object')
15698 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15699 : * "Create a new memoryview object"
15700 : * cdef __Pyx_memviewslice memviewslice
15701 : */
15702 :
15703 : /* function exit code */
15704 0 : __pyx_L1_error:;
15705 0 : __Pyx_XDECREF(__pyx_t_1);
15706 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15707 0 : __pyx_r = 0;
15708 0 : __pyx_L0:;
15709 0 : __Pyx_XGIVEREF(__pyx_r);
15710 0 : __Pyx_RefNannyFinishContext();
15711 0 : return __pyx_r;
15712 : }
15713 :
15714 : /* "View.MemoryView":1087
15715 : *
15716 : * @cname('__pyx_memoryview_copy_object_from_slice')
15717 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15718 : * """
15719 : * Create a new memoryview object from a given memoryview object and slice.
15720 : */
15721 :
15722 0 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15723 0 : PyObject *(*__pyx_v_to_object_func)(char *);
15724 0 : int (*__pyx_v_to_dtype_func)(char *, PyObject *);
15725 0 : PyObject *__pyx_r = NULL;
15726 : __Pyx_RefNannyDeclarations
15727 0 : int __pyx_t_1;
15728 0 : PyObject *(*__pyx_t_2)(char *);
15729 0 : int (*__pyx_t_3)(char *, PyObject *);
15730 0 : PyObject *__pyx_t_4 = NULL;
15731 0 : int __pyx_lineno = 0;
15732 0 : const char *__pyx_filename = NULL;
15733 0 : int __pyx_clineno = 0;
15734 0 : __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);
15735 :
15736 : /* "View.MemoryView":1094
15737 : * cdef int (*to_dtype_func)(char *, object) except 0
15738 : *
15739 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15740 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15741 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15742 : */
15743 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15744 0 : if (__pyx_t_1) {
15745 :
15746 : /* "View.MemoryView":1095
15747 : *
15748 : * if isinstance(memview, _memoryviewslice):
15749 : * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15750 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15751 : * else:
15752 : */
15753 0 : __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15754 0 : __pyx_v_to_object_func = __pyx_t_2;
15755 :
15756 : /* "View.MemoryView":1096
15757 : * if isinstance(memview, _memoryviewslice):
15758 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15759 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15760 : * else:
15761 : * to_object_func = NULL
15762 : */
15763 0 : __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15764 0 : __pyx_v_to_dtype_func = __pyx_t_3;
15765 :
15766 : /* "View.MemoryView":1094
15767 : * cdef int (*to_dtype_func)(char *, object) except 0
15768 : *
15769 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15770 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15771 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15772 : */
15773 0 : goto __pyx_L3;
15774 : }
15775 :
15776 : /* "View.MemoryView":1098
15777 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15778 : * else:
15779 : * to_object_func = NULL # <<<<<<<<<<<<<<
15780 : * to_dtype_func = NULL
15781 : *
15782 : */
15783 : /*else*/ {
15784 : __pyx_v_to_object_func = NULL;
15785 :
15786 : /* "View.MemoryView":1099
15787 : * else:
15788 : * to_object_func = NULL
15789 : * to_dtype_func = NULL # <<<<<<<<<<<<<<
15790 : *
15791 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15792 : */
15793 : __pyx_v_to_dtype_func = NULL;
15794 : }
15795 0 : __pyx_L3:;
15796 :
15797 : /* "View.MemoryView":1101
15798 : * to_dtype_func = NULL
15799 : *
15800 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15801 : * to_object_func, to_dtype_func,
15802 : * memview.dtype_is_object)
15803 : */
15804 0 : __Pyx_XDECREF(__pyx_r);
15805 :
15806 : /* "View.MemoryView":1103
15807 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15808 : * to_object_func, to_dtype_func,
15809 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
15810 : *
15811 : *
15812 : */
15813 0 : __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
15814 0 : __Pyx_GOTREF(__pyx_t_4);
15815 0 : __pyx_r = __pyx_t_4;
15816 0 : __pyx_t_4 = 0;
15817 0 : goto __pyx_L0;
15818 :
15819 : /* "View.MemoryView":1087
15820 : *
15821 : * @cname('__pyx_memoryview_copy_object_from_slice')
15822 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15823 : * """
15824 : * Create a new memoryview object from a given memoryview object and slice.
15825 : */
15826 :
15827 : /* function exit code */
15828 0 : __pyx_L1_error:;
15829 0 : __Pyx_XDECREF(__pyx_t_4);
15830 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15831 0 : __pyx_r = 0;
15832 0 : __pyx_L0:;
15833 0 : __Pyx_XGIVEREF(__pyx_r);
15834 0 : __Pyx_RefNannyFinishContext();
15835 0 : return __pyx_r;
15836 : }
15837 :
15838 : /* "View.MemoryView":1109
15839 : *
15840 : *
15841 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15842 : * return -arg if arg < 0 else arg
15843 : *
15844 : */
15845 :
15846 0 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15847 0 : Py_ssize_t __pyx_r;
15848 0 : Py_ssize_t __pyx_t_1;
15849 0 : int __pyx_t_2;
15850 :
15851 : /* "View.MemoryView":1110
15852 : *
15853 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
15854 : * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
15855 : *
15856 : * @cname('__pyx_get_best_slice_order')
15857 : */
15858 0 : __pyx_t_2 = (__pyx_v_arg < 0);
15859 0 : if (__pyx_t_2) {
15860 : __pyx_t_1 = (-__pyx_v_arg);
15861 : } else {
15862 : __pyx_t_1 = __pyx_v_arg;
15863 : }
15864 0 : __pyx_r = __pyx_t_1;
15865 0 : goto __pyx_L0;
15866 :
15867 : /* "View.MemoryView":1109
15868 : *
15869 : *
15870 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15871 : * return -arg if arg < 0 else arg
15872 : *
15873 : */
15874 :
15875 : /* function exit code */
15876 0 : __pyx_L0:;
15877 0 : return __pyx_r;
15878 : }
15879 :
15880 : /* "View.MemoryView":1113
15881 : *
15882 : * @cname('__pyx_get_best_slice_order')
15883 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
15884 : * """
15885 : * Figure out the best memory access order for a given slice.
15886 : */
15887 :
15888 0 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15889 0 : int __pyx_v_i;
15890 0 : Py_ssize_t __pyx_v_c_stride;
15891 0 : Py_ssize_t __pyx_v_f_stride;
15892 0 : char __pyx_r;
15893 0 : int __pyx_t_1;
15894 0 : int __pyx_t_2;
15895 0 : int __pyx_t_3;
15896 0 : int __pyx_t_4;
15897 :
15898 : /* "View.MemoryView":1118
15899 : * """
15900 : * cdef int i
15901 : * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
15902 : * cdef Py_ssize_t f_stride = 0
15903 : *
15904 : */
15905 0 : __pyx_v_c_stride = 0;
15906 :
15907 : /* "View.MemoryView":1119
15908 : * cdef int i
15909 : * cdef Py_ssize_t c_stride = 0
15910 : * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
15911 : *
15912 : * for i in range(ndim - 1, -1, -1):
15913 : */
15914 0 : __pyx_v_f_stride = 0;
15915 :
15916 : /* "View.MemoryView":1121
15917 : * cdef Py_ssize_t f_stride = 0
15918 : *
15919 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15920 : * if mslice.shape[i] > 1:
15921 : * c_stride = mslice.strides[i]
15922 : */
15923 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15924 0 : __pyx_v_i = __pyx_t_1;
15925 :
15926 : /* "View.MemoryView":1122
15927 : *
15928 : * for i in range(ndim - 1, -1, -1):
15929 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15930 : * c_stride = mslice.strides[i]
15931 : * break
15932 : */
15933 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15934 0 : if (__pyx_t_2) {
15935 :
15936 : /* "View.MemoryView":1123
15937 : * for i in range(ndim - 1, -1, -1):
15938 : * if mslice.shape[i] > 1:
15939 : * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15940 : * break
15941 : *
15942 : */
15943 0 : __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15944 :
15945 : /* "View.MemoryView":1124
15946 : * if mslice.shape[i] > 1:
15947 : * c_stride = mslice.strides[i]
15948 : * break # <<<<<<<<<<<<<<
15949 : *
15950 : * for i in range(ndim):
15951 : */
15952 0 : goto __pyx_L4_break;
15953 :
15954 : /* "View.MemoryView":1122
15955 : *
15956 : * for i in range(ndim - 1, -1, -1):
15957 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15958 : * c_stride = mslice.strides[i]
15959 : * break
15960 : */
15961 : }
15962 : }
15963 0 : __pyx_L4_break:;
15964 :
15965 : /* "View.MemoryView":1126
15966 : * break
15967 : *
15968 : * for i in range(ndim): # <<<<<<<<<<<<<<
15969 : * if mslice.shape[i] > 1:
15970 : * f_stride = mslice.strides[i]
15971 : */
15972 0 : __pyx_t_1 = __pyx_v_ndim;
15973 0 : __pyx_t_3 = __pyx_t_1;
15974 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15975 0 : __pyx_v_i = __pyx_t_4;
15976 :
15977 : /* "View.MemoryView":1127
15978 : *
15979 : * for i in range(ndim):
15980 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15981 : * f_stride = mslice.strides[i]
15982 : * break
15983 : */
15984 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15985 0 : if (__pyx_t_2) {
15986 :
15987 : /* "View.MemoryView":1128
15988 : * for i in range(ndim):
15989 : * if mslice.shape[i] > 1:
15990 : * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15991 : * break
15992 : *
15993 : */
15994 0 : __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15995 :
15996 : /* "View.MemoryView":1129
15997 : * if mslice.shape[i] > 1:
15998 : * f_stride = mslice.strides[i]
15999 : * break # <<<<<<<<<<<<<<
16000 : *
16001 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16002 : */
16003 0 : goto __pyx_L7_break;
16004 :
16005 : /* "View.MemoryView":1127
16006 : *
16007 : * for i in range(ndim):
16008 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16009 : * f_stride = mslice.strides[i]
16010 : * break
16011 : */
16012 : }
16013 : }
16014 0 : __pyx_L7_break:;
16015 :
16016 : /* "View.MemoryView":1131
16017 : * break
16018 : *
16019 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16020 : * return 'C'
16021 : * else:
16022 : */
16023 0 : __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16024 0 : if (__pyx_t_2) {
16025 :
16026 : /* "View.MemoryView":1132
16027 : *
16028 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16029 : * return 'C' # <<<<<<<<<<<<<<
16030 : * else:
16031 : * return 'F'
16032 : */
16033 0 : __pyx_r = 'C';
16034 0 : goto __pyx_L0;
16035 :
16036 : /* "View.MemoryView":1131
16037 : * break
16038 : *
16039 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16040 : * return 'C'
16041 : * else:
16042 : */
16043 : }
16044 :
16045 : /* "View.MemoryView":1134
16046 : * return 'C'
16047 : * else:
16048 : * return 'F' # <<<<<<<<<<<<<<
16049 : *
16050 : * @cython.cdivision(True)
16051 : */
16052 : /*else*/ {
16053 0 : __pyx_r = 'F';
16054 0 : goto __pyx_L0;
16055 : }
16056 :
16057 : /* "View.MemoryView":1113
16058 : *
16059 : * @cname('__pyx_get_best_slice_order')
16060 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16061 : * """
16062 : * Figure out the best memory access order for a given slice.
16063 : */
16064 :
16065 : /* function exit code */
16066 0 : __pyx_L0:;
16067 0 : return __pyx_r;
16068 : }
16069 :
16070 : /* "View.MemoryView":1137
16071 : *
16072 : * @cython.cdivision(True)
16073 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16074 : * char *dst_data, Py_ssize_t *dst_strides,
16075 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16076 : */
16077 :
16078 0 : static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16079 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16080 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16081 0 : Py_ssize_t __pyx_v_dst_extent;
16082 0 : Py_ssize_t __pyx_v_src_stride;
16083 0 : Py_ssize_t __pyx_v_dst_stride;
16084 0 : int __pyx_t_1;
16085 0 : int __pyx_t_2;
16086 0 : Py_ssize_t __pyx_t_3;
16087 0 : Py_ssize_t __pyx_t_4;
16088 0 : Py_ssize_t __pyx_t_5;
16089 :
16090 : /* "View.MemoryView":1144
16091 : *
16092 : * cdef Py_ssize_t i
16093 : * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16094 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16095 : * cdef Py_ssize_t src_stride = src_strides[0]
16096 : */
16097 0 : __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16098 :
16099 : /* "View.MemoryView":1145
16100 : * cdef Py_ssize_t i
16101 : * cdef Py_ssize_t src_extent = src_shape[0]
16102 : * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16103 : * cdef Py_ssize_t src_stride = src_strides[0]
16104 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16105 : */
16106 0 : __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16107 :
16108 : /* "View.MemoryView":1146
16109 : * cdef Py_ssize_t src_extent = src_shape[0]
16110 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16111 : * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16112 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16113 : *
16114 : */
16115 0 : __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16116 :
16117 : /* "View.MemoryView":1147
16118 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16119 : * cdef Py_ssize_t src_stride = src_strides[0]
16120 : * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16121 : *
16122 : * if ndim == 1:
16123 : */
16124 0 : __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16125 :
16126 : /* "View.MemoryView":1149
16127 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16128 : *
16129 : * if ndim == 1: # <<<<<<<<<<<<<<
16130 : * if (src_stride > 0 and dst_stride > 0 and
16131 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16132 : */
16133 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
16134 0 : if (__pyx_t_1) {
16135 :
16136 : /* "View.MemoryView":1150
16137 : *
16138 : * if ndim == 1:
16139 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16140 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16141 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16142 : */
16143 0 : __pyx_t_2 = (__pyx_v_src_stride > 0);
16144 0 : if (__pyx_t_2) {
16145 0 : } else {
16146 0 : __pyx_t_1 = __pyx_t_2;
16147 0 : goto __pyx_L5_bool_binop_done;
16148 : }
16149 0 : __pyx_t_2 = (__pyx_v_dst_stride > 0);
16150 0 : if (__pyx_t_2) {
16151 0 : } else {
16152 0 : __pyx_t_1 = __pyx_t_2;
16153 0 : goto __pyx_L5_bool_binop_done;
16154 : }
16155 :
16156 : /* "View.MemoryView":1151
16157 : * if ndim == 1:
16158 : * if (src_stride > 0 and dst_stride > 0 and
16159 : * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16160 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16161 : * else:
16162 : */
16163 0 : __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16164 0 : if (__pyx_t_2) {
16165 0 : __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16166 : }
16167 : __pyx_t_1 = __pyx_t_2;
16168 0 : __pyx_L5_bool_binop_done:;
16169 :
16170 : /* "View.MemoryView":1150
16171 : *
16172 : * if ndim == 1:
16173 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16174 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16175 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16176 : */
16177 0 : if (__pyx_t_1) {
16178 :
16179 : /* "View.MemoryView":1152
16180 : * if (src_stride > 0 and dst_stride > 0 and
16181 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16182 : * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
16183 : * else:
16184 : * for i in range(dst_extent):
16185 : */
16186 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16187 :
16188 : /* "View.MemoryView":1150
16189 : *
16190 : * if ndim == 1:
16191 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16192 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16193 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16194 : */
16195 0 : goto __pyx_L4;
16196 : }
16197 :
16198 : /* "View.MemoryView":1154
16199 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16200 : * else:
16201 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16202 : * memcpy(dst_data, src_data, itemsize)
16203 : * src_data += src_stride
16204 : */
16205 : /*else*/ {
16206 : __pyx_t_3 = __pyx_v_dst_extent;
16207 : __pyx_t_4 = __pyx_t_3;
16208 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16209 0 : __pyx_v_i = __pyx_t_5;
16210 :
16211 : /* "View.MemoryView":1155
16212 : * else:
16213 : * for i in range(dst_extent):
16214 : * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16215 : * src_data += src_stride
16216 : * dst_data += dst_stride
16217 : */
16218 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16219 :
16220 : /* "View.MemoryView":1156
16221 : * for i in range(dst_extent):
16222 : * memcpy(dst_data, src_data, itemsize)
16223 : * src_data += src_stride # <<<<<<<<<<<<<<
16224 : * dst_data += dst_stride
16225 : * else:
16226 : */
16227 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16228 :
16229 : /* "View.MemoryView":1157
16230 : * memcpy(dst_data, src_data, itemsize)
16231 : * src_data += src_stride
16232 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16233 : * else:
16234 : * for i in range(dst_extent):
16235 : */
16236 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16237 : }
16238 : }
16239 0 : __pyx_L4:;
16240 :
16241 : /* "View.MemoryView":1149
16242 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16243 : *
16244 : * if ndim == 1: # <<<<<<<<<<<<<<
16245 : * if (src_stride > 0 and dst_stride > 0 and
16246 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16247 : */
16248 0 : goto __pyx_L3;
16249 : }
16250 :
16251 : /* "View.MemoryView":1159
16252 : * dst_data += dst_stride
16253 : * else:
16254 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16255 : * _copy_strided_to_strided(src_data, src_strides + 1,
16256 : * dst_data, dst_strides + 1,
16257 : */
16258 : /*else*/ {
16259 : __pyx_t_3 = __pyx_v_dst_extent;
16260 : __pyx_t_4 = __pyx_t_3;
16261 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16262 0 : __pyx_v_i = __pyx_t_5;
16263 :
16264 : /* "View.MemoryView":1160
16265 : * else:
16266 : * for i in range(dst_extent):
16267 : * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16268 : * dst_data, dst_strides + 1,
16269 : * src_shape + 1, dst_shape + 1,
16270 : */
16271 0 : _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16272 :
16273 : /* "View.MemoryView":1164
16274 : * src_shape + 1, dst_shape + 1,
16275 : * ndim - 1, itemsize)
16276 : * src_data += src_stride # <<<<<<<<<<<<<<
16277 : * dst_data += dst_stride
16278 : *
16279 : */
16280 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16281 :
16282 : /* "View.MemoryView":1165
16283 : * ndim - 1, itemsize)
16284 : * src_data += src_stride
16285 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16286 : *
16287 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16288 : */
16289 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16290 : }
16291 : }
16292 0 : __pyx_L3:;
16293 :
16294 : /* "View.MemoryView":1137
16295 : *
16296 : * @cython.cdivision(True)
16297 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16298 : * char *dst_data, Py_ssize_t *dst_strides,
16299 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16300 : */
16301 :
16302 : /* function exit code */
16303 0 : }
16304 :
16305 : /* "View.MemoryView":1167
16306 : * dst_data += dst_stride
16307 : *
16308 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16309 : * __Pyx_memviewslice *dst,
16310 : * int ndim, size_t itemsize) noexcept nogil:
16311 : */
16312 :
16313 0 : static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16314 :
16315 : /* "View.MemoryView":1170
16316 : * __Pyx_memviewslice *dst,
16317 : * int ndim, size_t itemsize) noexcept nogil:
16318 : * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16319 : * src.shape, dst.shape, ndim, itemsize)
16320 : *
16321 : */
16322 0 : _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16323 :
16324 : /* "View.MemoryView":1167
16325 : * dst_data += dst_stride
16326 : *
16327 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16328 : * __Pyx_memviewslice *dst,
16329 : * int ndim, size_t itemsize) noexcept nogil:
16330 : */
16331 :
16332 : /* function exit code */
16333 0 : }
16334 :
16335 : /* "View.MemoryView":1174
16336 : *
16337 : * @cname('__pyx_memoryview_slice_get_size')
16338 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16339 : * "Return the size of the memory occupied by the slice in number of bytes"
16340 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16341 : */
16342 :
16343 0 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16344 0 : Py_ssize_t __pyx_v_shape;
16345 0 : Py_ssize_t __pyx_v_size;
16346 0 : Py_ssize_t __pyx_r;
16347 0 : Py_ssize_t __pyx_t_1;
16348 0 : Py_ssize_t *__pyx_t_2;
16349 0 : Py_ssize_t *__pyx_t_3;
16350 0 : Py_ssize_t *__pyx_t_4;
16351 :
16352 : /* "View.MemoryView":1176
16353 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16354 : * "Return the size of the memory occupied by the slice in number of bytes"
16355 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
16356 : *
16357 : * for shape in src.shape[:ndim]:
16358 : */
16359 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16360 0 : __pyx_v_size = __pyx_t_1;
16361 :
16362 : /* "View.MemoryView":1178
16363 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16364 : *
16365 : * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16366 : * size *= shape
16367 : *
16368 : */
16369 0 : __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
16370 0 : for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16371 0 : __pyx_t_2 = __pyx_t_4;
16372 0 : __pyx_v_shape = (__pyx_t_2[0]);
16373 :
16374 : /* "View.MemoryView":1179
16375 : *
16376 : * for shape in src.shape[:ndim]:
16377 : * size *= shape # <<<<<<<<<<<<<<
16378 : *
16379 : * return size
16380 : */
16381 0 : __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
16382 : }
16383 :
16384 : /* "View.MemoryView":1181
16385 : * size *= shape
16386 : *
16387 : * return size # <<<<<<<<<<<<<<
16388 : *
16389 : * @cname('__pyx_fill_contig_strides_array')
16390 : */
16391 0 : __pyx_r = __pyx_v_size;
16392 0 : goto __pyx_L0;
16393 :
16394 : /* "View.MemoryView":1174
16395 : *
16396 : * @cname('__pyx_memoryview_slice_get_size')
16397 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16398 : * "Return the size of the memory occupied by the slice in number of bytes"
16399 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16400 : */
16401 :
16402 : /* function exit code */
16403 0 : __pyx_L0:;
16404 0 : return __pyx_r;
16405 : }
16406 :
16407 : /* "View.MemoryView":1184
16408 : *
16409 : * @cname('__pyx_fill_contig_strides_array')
16410 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16411 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16412 : * int ndim, char order) noexcept nogil:
16413 : */
16414 :
16415 0 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16416 0 : int __pyx_v_idx;
16417 0 : Py_ssize_t __pyx_r;
16418 0 : int __pyx_t_1;
16419 0 : int __pyx_t_2;
16420 0 : int __pyx_t_3;
16421 0 : int __pyx_t_4;
16422 :
16423 : /* "View.MemoryView":1193
16424 : * cdef int idx
16425 : *
16426 : * if order == 'F': # <<<<<<<<<<<<<<
16427 : * for idx in range(ndim):
16428 : * strides[idx] = stride
16429 : */
16430 0 : __pyx_t_1 = (__pyx_v_order == 'F');
16431 0 : if (__pyx_t_1) {
16432 :
16433 : /* "View.MemoryView":1194
16434 : *
16435 : * if order == 'F':
16436 : * for idx in range(ndim): # <<<<<<<<<<<<<<
16437 : * strides[idx] = stride
16438 : * stride *= shape[idx]
16439 : */
16440 0 : __pyx_t_2 = __pyx_v_ndim;
16441 : __pyx_t_3 = __pyx_t_2;
16442 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16443 0 : __pyx_v_idx = __pyx_t_4;
16444 :
16445 : /* "View.MemoryView":1195
16446 : * if order == 'F':
16447 : * for idx in range(ndim):
16448 : * strides[idx] = stride # <<<<<<<<<<<<<<
16449 : * stride *= shape[idx]
16450 : * else:
16451 : */
16452 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16453 :
16454 : /* "View.MemoryView":1196
16455 : * for idx in range(ndim):
16456 : * strides[idx] = stride
16457 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16458 : * else:
16459 : * for idx in range(ndim - 1, -1, -1):
16460 : */
16461 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16462 : }
16463 :
16464 : /* "View.MemoryView":1193
16465 : * cdef int idx
16466 : *
16467 : * if order == 'F': # <<<<<<<<<<<<<<
16468 : * for idx in range(ndim):
16469 : * strides[idx] = stride
16470 : */
16471 0 : goto __pyx_L3;
16472 : }
16473 :
16474 : /* "View.MemoryView":1198
16475 : * stride *= shape[idx]
16476 : * else:
16477 : * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16478 : * strides[idx] = stride
16479 : * stride *= shape[idx]
16480 : */
16481 : /*else*/ {
16482 0 : for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16483 0 : __pyx_v_idx = __pyx_t_2;
16484 :
16485 : /* "View.MemoryView":1199
16486 : * else:
16487 : * for idx in range(ndim - 1, -1, -1):
16488 : * strides[idx] = stride # <<<<<<<<<<<<<<
16489 : * stride *= shape[idx]
16490 : *
16491 : */
16492 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16493 :
16494 : /* "View.MemoryView":1200
16495 : * for idx in range(ndim - 1, -1, -1):
16496 : * strides[idx] = stride
16497 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16498 : *
16499 : * return stride
16500 : */
16501 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16502 : }
16503 : }
16504 0 : __pyx_L3:;
16505 :
16506 : /* "View.MemoryView":1202
16507 : * stride *= shape[idx]
16508 : *
16509 : * return stride # <<<<<<<<<<<<<<
16510 : *
16511 : * @cname('__pyx_memoryview_copy_data_to_temp')
16512 : */
16513 0 : __pyx_r = __pyx_v_stride;
16514 0 : goto __pyx_L0;
16515 :
16516 : /* "View.MemoryView":1184
16517 : *
16518 : * @cname('__pyx_fill_contig_strides_array')
16519 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16520 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16521 : * int ndim, char order) noexcept nogil:
16522 : */
16523 :
16524 : /* function exit code */
16525 0 : __pyx_L0:;
16526 0 : return __pyx_r;
16527 : }
16528 :
16529 : /* "View.MemoryView":1205
16530 : *
16531 : * @cname('__pyx_memoryview_copy_data_to_temp')
16532 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16533 : * __Pyx_memviewslice *tmpslice,
16534 : * char order,
16535 : */
16536 :
16537 0 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
16538 0 : int __pyx_v_i;
16539 0 : void *__pyx_v_result;
16540 0 : size_t __pyx_v_itemsize;
16541 0 : size_t __pyx_v_size;
16542 0 : void *__pyx_r;
16543 0 : Py_ssize_t __pyx_t_1;
16544 0 : int __pyx_t_2;
16545 0 : int __pyx_t_3;
16546 0 : struct __pyx_memoryview_obj *__pyx_t_4;
16547 0 : int __pyx_t_5;
16548 0 : int __pyx_t_6;
16549 0 : int __pyx_lineno = 0;
16550 0 : const char *__pyx_filename = NULL;
16551 0 : int __pyx_clineno = 0;
16552 : #ifdef WITH_THREAD
16553 0 : PyGILState_STATE __pyx_gilstate_save;
16554 : #endif
16555 :
16556 : /* "View.MemoryView":1216
16557 : * cdef void *result
16558 : *
16559 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
16560 : * cdef size_t size = slice_get_size(src, ndim)
16561 : *
16562 : */
16563 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16564 0 : __pyx_v_itemsize = __pyx_t_1;
16565 :
16566 : /* "View.MemoryView":1217
16567 : *
16568 : * cdef size_t itemsize = src.memview.view.itemsize
16569 : * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16570 : *
16571 : * result = malloc(size)
16572 : */
16573 0 : __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16574 :
16575 : /* "View.MemoryView":1219
16576 : * cdef size_t size = slice_get_size(src, ndim)
16577 : *
16578 : * result = malloc(size) # <<<<<<<<<<<<<<
16579 : * if not result:
16580 : * _err_no_memory()
16581 : */
16582 0 : __pyx_v_result = malloc(__pyx_v_size);
16583 :
16584 : /* "View.MemoryView":1220
16585 : *
16586 : * result = malloc(size)
16587 : * if not result: # <<<<<<<<<<<<<<
16588 : * _err_no_memory()
16589 : *
16590 : */
16591 0 : __pyx_t_2 = (!(__pyx_v_result != 0));
16592 0 : if (__pyx_t_2) {
16593 :
16594 : /* "View.MemoryView":1221
16595 : * result = malloc(size)
16596 : * if not result:
16597 : * _err_no_memory() # <<<<<<<<<<<<<<
16598 : *
16599 : *
16600 : */
16601 0 : __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
16602 :
16603 : /* "View.MemoryView":1220
16604 : *
16605 : * result = malloc(size)
16606 : * if not result: # <<<<<<<<<<<<<<
16607 : * _err_no_memory()
16608 : *
16609 : */
16610 : }
16611 :
16612 : /* "View.MemoryView":1224
16613 : *
16614 : *
16615 : * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16616 : * tmpslice.memview = src.memview
16617 : * for i in range(ndim):
16618 : */
16619 0 : __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16620 :
16621 : /* "View.MemoryView":1225
16622 : *
16623 : * tmpslice.data = <char *> result
16624 : * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16625 : * for i in range(ndim):
16626 : * tmpslice.shape[i] = src.shape[i]
16627 : */
16628 0 : __pyx_t_4 = __pyx_v_src->memview;
16629 0 : __pyx_v_tmpslice->memview = __pyx_t_4;
16630 :
16631 : /* "View.MemoryView":1226
16632 : * tmpslice.data = <char *> result
16633 : * tmpslice.memview = src.memview
16634 : * for i in range(ndim): # <<<<<<<<<<<<<<
16635 : * tmpslice.shape[i] = src.shape[i]
16636 : * tmpslice.suboffsets[i] = -1
16637 : */
16638 0 : __pyx_t_3 = __pyx_v_ndim;
16639 0 : __pyx_t_5 = __pyx_t_3;
16640 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16641 0 : __pyx_v_i = __pyx_t_6;
16642 :
16643 : /* "View.MemoryView":1227
16644 : * tmpslice.memview = src.memview
16645 : * for i in range(ndim):
16646 : * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16647 : * tmpslice.suboffsets[i] = -1
16648 : *
16649 : */
16650 0 : (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16651 :
16652 : /* "View.MemoryView":1228
16653 : * for i in range(ndim):
16654 : * tmpslice.shape[i] = src.shape[i]
16655 : * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16656 : *
16657 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
16658 : */
16659 0 : (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16660 : }
16661 :
16662 : /* "View.MemoryView":1230
16663 : * tmpslice.suboffsets[i] = -1
16664 : *
16665 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
16666 : *
16667 : *
16668 : */
16669 0 : (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
16670 :
16671 : /* "View.MemoryView":1233
16672 : *
16673 : *
16674 : * for i in range(ndim): # <<<<<<<<<<<<<<
16675 : * if tmpslice.shape[i] == 1:
16676 : * tmpslice.strides[i] = 0
16677 : */
16678 0 : __pyx_t_3 = __pyx_v_ndim;
16679 0 : __pyx_t_5 = __pyx_t_3;
16680 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16681 0 : __pyx_v_i = __pyx_t_6;
16682 :
16683 : /* "View.MemoryView":1234
16684 : *
16685 : * for i in range(ndim):
16686 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16687 : * tmpslice.strides[i] = 0
16688 : *
16689 : */
16690 0 : __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16691 0 : if (__pyx_t_2) {
16692 :
16693 : /* "View.MemoryView":1235
16694 : * for i in range(ndim):
16695 : * if tmpslice.shape[i] == 1:
16696 : * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16697 : *
16698 : * if slice_is_contig(src[0], order, ndim):
16699 : */
16700 0 : (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16701 :
16702 : /* "View.MemoryView":1234
16703 : *
16704 : * for i in range(ndim):
16705 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16706 : * tmpslice.strides[i] = 0
16707 : *
16708 : */
16709 : }
16710 : }
16711 :
16712 : /* "View.MemoryView":1237
16713 : * tmpslice.strides[i] = 0
16714 : *
16715 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16716 : * memcpy(result, src.data, size)
16717 : * else:
16718 : */
16719 0 : __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16720 0 : if (__pyx_t_2) {
16721 :
16722 : /* "View.MemoryView":1238
16723 : *
16724 : * if slice_is_contig(src[0], order, ndim):
16725 : * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16726 : * else:
16727 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16728 : */
16729 0 : (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16730 :
16731 : /* "View.MemoryView":1237
16732 : * tmpslice.strides[i] = 0
16733 : *
16734 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16735 : * memcpy(result, src.data, size)
16736 : * else:
16737 : */
16738 0 : goto __pyx_L9;
16739 : }
16740 :
16741 : /* "View.MemoryView":1240
16742 : * memcpy(result, src.data, size)
16743 : * else:
16744 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16745 : *
16746 : * return result
16747 : */
16748 : /*else*/ {
16749 0 : copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16750 : }
16751 0 : __pyx_L9:;
16752 :
16753 : /* "View.MemoryView":1242
16754 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16755 : *
16756 : * return result # <<<<<<<<<<<<<<
16757 : *
16758 : *
16759 : */
16760 0 : __pyx_r = __pyx_v_result;
16761 0 : goto __pyx_L0;
16762 :
16763 : /* "View.MemoryView":1205
16764 : *
16765 : * @cname('__pyx_memoryview_copy_data_to_temp')
16766 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16767 : * __Pyx_memviewslice *tmpslice,
16768 : * char order,
16769 : */
16770 :
16771 : /* function exit code */
16772 0 : __pyx_L1_error:;
16773 : #ifdef WITH_THREAD
16774 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16775 : #endif
16776 0 : __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16777 0 : __pyx_r = NULL;
16778 : #ifdef WITH_THREAD
16779 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16780 : #endif
16781 0 : __pyx_L0:;
16782 0 : return __pyx_r;
16783 : }
16784 :
16785 : /* "View.MemoryView":1247
16786 : *
16787 : * @cname('__pyx_memoryview_err_extents')
16788 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16789 : * Py_ssize_t extent2) except -1 with gil:
16790 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16791 : */
16792 :
16793 0 : static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16794 0 : int __pyx_r;
16795 : __Pyx_RefNannyDeclarations
16796 0 : PyObject *__pyx_t_1 = NULL;
16797 0 : Py_ssize_t __pyx_t_2;
16798 0 : Py_UCS4 __pyx_t_3;
16799 0 : PyObject *__pyx_t_4 = NULL;
16800 0 : int __pyx_lineno = 0;
16801 0 : const char *__pyx_filename = NULL;
16802 0 : int __pyx_clineno = 0;
16803 : #ifdef WITH_THREAD
16804 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16805 : #endif
16806 0 : __Pyx_RefNannySetupContext("_err_extents", 0);
16807 :
16808 : /* "View.MemoryView":1249
16809 : * cdef int _err_extents(int i, Py_ssize_t extent1,
16810 : * Py_ssize_t extent2) except -1 with gil:
16811 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
16812 : *
16813 : * @cname('__pyx_memoryview_err_dim')
16814 : */
16815 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
16816 0 : __Pyx_GOTREF(__pyx_t_1);
16817 0 : __pyx_t_2 = 0;
16818 0 : __pyx_t_3 = 127;
16819 0 : __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16820 0 : __pyx_t_2 += 35;
16821 0 : __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16822 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
16823 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16824 0 : __Pyx_GOTREF(__pyx_t_4);
16825 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16826 0 : __Pyx_GIVEREF(__pyx_t_4);
16827 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
16828 0 : __pyx_t_4 = 0;
16829 0 : __Pyx_INCREF(__pyx_kp_u_got);
16830 0 : __pyx_t_2 += 6;
16831 0 : __Pyx_GIVEREF(__pyx_kp_u_got);
16832 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
16833 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16834 0 : __Pyx_GOTREF(__pyx_t_4);
16835 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16836 0 : __Pyx_GIVEREF(__pyx_t_4);
16837 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
16838 0 : __pyx_t_4 = 0;
16839 0 : __Pyx_INCREF(__pyx_kp_u_and);
16840 0 : __pyx_t_2 += 5;
16841 0 : __Pyx_GIVEREF(__pyx_kp_u_and);
16842 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
16843 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16844 0 : __Pyx_GOTREF(__pyx_t_4);
16845 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16846 0 : __Pyx_GIVEREF(__pyx_t_4);
16847 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
16848 0 : __pyx_t_4 = 0;
16849 0 : __Pyx_INCREF(__pyx_kp_u__7);
16850 0 : __pyx_t_2 += 1;
16851 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
16852 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7);
16853 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16854 0 : __Pyx_GOTREF(__pyx_t_4);
16855 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16856 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
16857 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16858 0 : __PYX_ERR(1, 1249, __pyx_L1_error)
16859 :
16860 : /* "View.MemoryView":1247
16861 : *
16862 : * @cname('__pyx_memoryview_err_extents')
16863 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16864 : * Py_ssize_t extent2) except -1 with gil:
16865 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16866 : */
16867 :
16868 : /* function exit code */
16869 0 : __pyx_L1_error:;
16870 0 : __Pyx_XDECREF(__pyx_t_1);
16871 0 : __Pyx_XDECREF(__pyx_t_4);
16872 0 : __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
16873 0 : __pyx_r = -1;
16874 0 : __Pyx_RefNannyFinishContext();
16875 : #ifdef WITH_THREAD
16876 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16877 : #endif
16878 0 : return __pyx_r;
16879 : }
16880 :
16881 : /* "View.MemoryView":1252
16882 : *
16883 : * @cname('__pyx_memoryview_err_dim')
16884 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16885 : * raise <object>error, msg % dim
16886 : *
16887 : */
16888 :
16889 0 : static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
16890 0 : int __pyx_r;
16891 : __Pyx_RefNannyDeclarations
16892 0 : PyObject *__pyx_t_1 = NULL;
16893 0 : PyObject *__pyx_t_2 = NULL;
16894 0 : int __pyx_lineno = 0;
16895 0 : const char *__pyx_filename = NULL;
16896 0 : int __pyx_clineno = 0;
16897 : #ifdef WITH_THREAD
16898 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16899 : #endif
16900 0 : __Pyx_RefNannySetupContext("_err_dim", 0);
16901 0 : __Pyx_INCREF(__pyx_v_msg);
16902 :
16903 : /* "View.MemoryView":1253
16904 : * @cname('__pyx_memoryview_err_dim')
16905 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
16906 : * raise <object>error, msg % dim # <<<<<<<<<<<<<<
16907 : *
16908 : * @cname('__pyx_memoryview_err')
16909 : */
16910 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
16911 0 : __Pyx_GOTREF(__pyx_t_1);
16912 0 : __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
16913 0 : __Pyx_GOTREF(__pyx_t_2);
16914 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16915 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
16916 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16917 0 : __PYX_ERR(1, 1253, __pyx_L1_error)
16918 :
16919 : /* "View.MemoryView":1252
16920 : *
16921 : * @cname('__pyx_memoryview_err_dim')
16922 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16923 : * raise <object>error, msg % dim
16924 : *
16925 : */
16926 :
16927 : /* function exit code */
16928 0 : __pyx_L1_error:;
16929 0 : __Pyx_XDECREF(__pyx_t_1);
16930 0 : __Pyx_XDECREF(__pyx_t_2);
16931 0 : __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
16932 0 : __pyx_r = -1;
16933 0 : __Pyx_XDECREF(__pyx_v_msg);
16934 0 : __Pyx_RefNannyFinishContext();
16935 : #ifdef WITH_THREAD
16936 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16937 : #endif
16938 0 : return __pyx_r;
16939 : }
16940 :
16941 : /* "View.MemoryView":1256
16942 : *
16943 : * @cname('__pyx_memoryview_err')
16944 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16945 : * raise <object>error, msg
16946 : *
16947 : */
16948 :
16949 0 : static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
16950 0 : int __pyx_r;
16951 : __Pyx_RefNannyDeclarations
16952 0 : int __pyx_lineno = 0;
16953 0 : const char *__pyx_filename = NULL;
16954 0 : int __pyx_clineno = 0;
16955 : #ifdef WITH_THREAD
16956 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16957 : #endif
16958 0 : __Pyx_RefNannySetupContext("_err", 0);
16959 0 : __Pyx_INCREF(__pyx_v_msg);
16960 :
16961 : /* "View.MemoryView":1257
16962 : * @cname('__pyx_memoryview_err')
16963 : * cdef int _err(PyObject *error, str msg) except -1 with gil:
16964 : * raise <object>error, msg # <<<<<<<<<<<<<<
16965 : *
16966 : * @cname('__pyx_memoryview_err_no_memory')
16967 : */
16968 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
16969 0 : __PYX_ERR(1, 1257, __pyx_L1_error)
16970 :
16971 : /* "View.MemoryView":1256
16972 : *
16973 : * @cname('__pyx_memoryview_err')
16974 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16975 : * raise <object>error, msg
16976 : *
16977 : */
16978 :
16979 : /* function exit code */
16980 0 : __pyx_L1_error:;
16981 0 : __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
16982 0 : __pyx_r = -1;
16983 0 : __Pyx_XDECREF(__pyx_v_msg);
16984 0 : __Pyx_RefNannyFinishContext();
16985 : #ifdef WITH_THREAD
16986 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16987 : #endif
16988 0 : return __pyx_r;
16989 : }
16990 :
16991 : /* "View.MemoryView":1260
16992 : *
16993 : * @cname('__pyx_memoryview_err_no_memory')
16994 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
16995 : * raise MemoryError
16996 : *
16997 : */
16998 :
16999 0 : static int __pyx_memoryview_err_no_memory(void) {
17000 0 : int __pyx_r;
17001 0 : int __pyx_lineno = 0;
17002 0 : const char *__pyx_filename = NULL;
17003 0 : int __pyx_clineno = 0;
17004 : #ifdef WITH_THREAD
17005 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17006 : #endif
17007 :
17008 : /* "View.MemoryView":1261
17009 : * @cname('__pyx_memoryview_err_no_memory')
17010 : * cdef int _err_no_memory() except -1 with gil:
17011 : * raise MemoryError # <<<<<<<<<<<<<<
17012 : *
17013 : *
17014 : */
17015 0 : PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
17016 :
17017 : /* "View.MemoryView":1260
17018 : *
17019 : * @cname('__pyx_memoryview_err_no_memory')
17020 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
17021 : * raise MemoryError
17022 : *
17023 : */
17024 :
17025 : /* function exit code */
17026 0 : __pyx_L1_error:;
17027 0 : __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17028 0 : __pyx_r = -1;
17029 : #ifdef WITH_THREAD
17030 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17031 : #endif
17032 0 : return __pyx_r;
17033 : }
17034 :
17035 : /* "View.MemoryView":1265
17036 : *
17037 : * @cname('__pyx_memoryview_copy_contents')
17038 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17039 : * __Pyx_memviewslice dst,
17040 : * int src_ndim, int dst_ndim,
17041 : */
17042 :
17043 0 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17044 0 : void *__pyx_v_tmpdata;
17045 0 : size_t __pyx_v_itemsize;
17046 0 : int __pyx_v_i;
17047 0 : char __pyx_v_order;
17048 0 : int __pyx_v_broadcasting;
17049 0 : int __pyx_v_direct_copy;
17050 0 : __Pyx_memviewslice __pyx_v_tmp;
17051 0 : int __pyx_v_ndim;
17052 0 : int __pyx_r;
17053 0 : Py_ssize_t __pyx_t_1;
17054 0 : int __pyx_t_2;
17055 0 : int __pyx_t_3;
17056 0 : int __pyx_t_4;
17057 0 : int __pyx_t_5;
17058 0 : int __pyx_t_6;
17059 0 : void *__pyx_t_7;
17060 0 : int __pyx_lineno = 0;
17061 0 : const char *__pyx_filename = NULL;
17062 0 : int __pyx_clineno = 0;
17063 : #ifdef WITH_THREAD
17064 0 : PyGILState_STATE __pyx_gilstate_save;
17065 : #endif
17066 :
17067 : /* "View.MemoryView":1273
17068 : * Check for overlapping memory and verify the shapes.
17069 : * """
17070 : * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17071 : * cdef size_t itemsize = src.memview.view.itemsize
17072 : * cdef int i
17073 : */
17074 0 : __pyx_v_tmpdata = NULL;
17075 :
17076 : /* "View.MemoryView":1274
17077 : * """
17078 : * cdef void *tmpdata = NULL
17079 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17080 : * cdef int i
17081 : * cdef char order = get_best_order(&src, src_ndim)
17082 : */
17083 0 : __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17084 0 : __pyx_v_itemsize = __pyx_t_1;
17085 :
17086 : /* "View.MemoryView":1276
17087 : * cdef size_t itemsize = src.memview.view.itemsize
17088 : * cdef int i
17089 : * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17090 : * cdef bint broadcasting = False
17091 : * cdef bint direct_copy = False
17092 : */
17093 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17094 :
17095 : /* "View.MemoryView":1277
17096 : * cdef int i
17097 : * cdef char order = get_best_order(&src, src_ndim)
17098 : * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17099 : * cdef bint direct_copy = False
17100 : * cdef __Pyx_memviewslice tmp
17101 : */
17102 0 : __pyx_v_broadcasting = 0;
17103 :
17104 : /* "View.MemoryView":1278
17105 : * cdef char order = get_best_order(&src, src_ndim)
17106 : * cdef bint broadcasting = False
17107 : * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17108 : * cdef __Pyx_memviewslice tmp
17109 : *
17110 : */
17111 0 : __pyx_v_direct_copy = 0;
17112 :
17113 : /* "View.MemoryView":1281
17114 : * cdef __Pyx_memviewslice tmp
17115 : *
17116 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17117 : * broadcast_leading(&src, src_ndim, dst_ndim)
17118 : * elif dst_ndim < src_ndim:
17119 : */
17120 0 : __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17121 0 : if (__pyx_t_2) {
17122 :
17123 : /* "View.MemoryView":1282
17124 : *
17125 : * if src_ndim < dst_ndim:
17126 : * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17127 : * elif dst_ndim < src_ndim:
17128 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17129 : */
17130 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17131 :
17132 : /* "View.MemoryView":1281
17133 : * cdef __Pyx_memviewslice tmp
17134 : *
17135 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17136 : * broadcast_leading(&src, src_ndim, dst_ndim)
17137 : * elif dst_ndim < src_ndim:
17138 : */
17139 0 : goto __pyx_L3;
17140 : }
17141 :
17142 : /* "View.MemoryView":1283
17143 : * if src_ndim < dst_ndim:
17144 : * broadcast_leading(&src, src_ndim, dst_ndim)
17145 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17146 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17147 : *
17148 : */
17149 0 : __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17150 0 : if (__pyx_t_2) {
17151 :
17152 : /* "View.MemoryView":1284
17153 : * broadcast_leading(&src, src_ndim, dst_ndim)
17154 : * elif dst_ndim < src_ndim:
17155 : * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17156 : *
17157 : * cdef int ndim = max(src_ndim, dst_ndim)
17158 : */
17159 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17160 :
17161 : /* "View.MemoryView":1283
17162 : * if src_ndim < dst_ndim:
17163 : * broadcast_leading(&src, src_ndim, dst_ndim)
17164 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17165 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17166 : *
17167 : */
17168 : }
17169 0 : __pyx_L3:;
17170 :
17171 : /* "View.MemoryView":1286
17172 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17173 : *
17174 : * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17175 : *
17176 : * for i in range(ndim):
17177 : */
17178 0 : __pyx_t_3 = __pyx_v_dst_ndim;
17179 0 : __pyx_t_4 = __pyx_v_src_ndim;
17180 0 : __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
17181 0 : if (__pyx_t_2) {
17182 : __pyx_t_5 = __pyx_t_3;
17183 : } else {
17184 : __pyx_t_5 = __pyx_t_4;
17185 : }
17186 0 : __pyx_v_ndim = __pyx_t_5;
17187 :
17188 : /* "View.MemoryView":1288
17189 : * cdef int ndim = max(src_ndim, dst_ndim)
17190 : *
17191 : * for i in range(ndim): # <<<<<<<<<<<<<<
17192 : * if src.shape[i] != dst.shape[i]:
17193 : * if src.shape[i] == 1:
17194 : */
17195 0 : __pyx_t_5 = __pyx_v_ndim;
17196 0 : __pyx_t_3 = __pyx_t_5;
17197 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17198 0 : __pyx_v_i = __pyx_t_4;
17199 :
17200 : /* "View.MemoryView":1289
17201 : *
17202 : * for i in range(ndim):
17203 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17204 : * if src.shape[i] == 1:
17205 : * broadcasting = True
17206 : */
17207 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17208 0 : if (__pyx_t_2) {
17209 :
17210 : /* "View.MemoryView":1290
17211 : * for i in range(ndim):
17212 : * if src.shape[i] != dst.shape[i]:
17213 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17214 : * broadcasting = True
17215 : * src.strides[i] = 0
17216 : */
17217 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17218 0 : if (__pyx_t_2) {
17219 :
17220 : /* "View.MemoryView":1291
17221 : * if src.shape[i] != dst.shape[i]:
17222 : * if src.shape[i] == 1:
17223 : * broadcasting = True # <<<<<<<<<<<<<<
17224 : * src.strides[i] = 0
17225 : * else:
17226 : */
17227 0 : __pyx_v_broadcasting = 1;
17228 :
17229 : /* "View.MemoryView":1292
17230 : * if src.shape[i] == 1:
17231 : * broadcasting = True
17232 : * src.strides[i] = 0 # <<<<<<<<<<<<<<
17233 : * else:
17234 : * _err_extents(i, dst.shape[i], src.shape[i])
17235 : */
17236 0 : (__pyx_v_src.strides[__pyx_v_i]) = 0;
17237 :
17238 : /* "View.MemoryView":1290
17239 : * for i in range(ndim):
17240 : * if src.shape[i] != dst.shape[i]:
17241 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17242 : * broadcasting = True
17243 : * src.strides[i] = 0
17244 : */
17245 0 : goto __pyx_L7;
17246 : }
17247 :
17248 : /* "View.MemoryView":1294
17249 : * src.strides[i] = 0
17250 : * else:
17251 : * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17252 : *
17253 : * if src.suboffsets[i] >= 0:
17254 : */
17255 : /*else*/ {
17256 0 : __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
17257 : }
17258 0 : __pyx_L7:;
17259 :
17260 : /* "View.MemoryView":1289
17261 : *
17262 : * for i in range(ndim):
17263 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17264 : * if src.shape[i] == 1:
17265 : * broadcasting = True
17266 : */
17267 : }
17268 :
17269 : /* "View.MemoryView":1296
17270 : * _err_extents(i, dst.shape[i], src.shape[i])
17271 : *
17272 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17273 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17274 : *
17275 : */
17276 0 : __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17277 0 : if (__pyx_t_2) {
17278 :
17279 : /* "View.MemoryView":1297
17280 : *
17281 : * if src.suboffsets[i] >= 0:
17282 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17283 : *
17284 : * if slices_overlap(&src, &dst, ndim, itemsize):
17285 : */
17286 0 : __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
17287 :
17288 : /* "View.MemoryView":1296
17289 : * _err_extents(i, dst.shape[i], src.shape[i])
17290 : *
17291 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17292 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17293 : *
17294 : */
17295 : }
17296 : }
17297 :
17298 : /* "View.MemoryView":1299
17299 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17300 : *
17301 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17302 : *
17303 : * if not slice_is_contig(src, order, ndim):
17304 : */
17305 0 : __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17306 0 : if (__pyx_t_2) {
17307 :
17308 : /* "View.MemoryView":1301
17309 : * if slices_overlap(&src, &dst, ndim, itemsize):
17310 : *
17311 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17312 : * order = get_best_order(&dst, ndim)
17313 : *
17314 : */
17315 0 : __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17316 0 : if (__pyx_t_2) {
17317 :
17318 : /* "View.MemoryView":1302
17319 : *
17320 : * if not slice_is_contig(src, order, ndim):
17321 : * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17322 : *
17323 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17324 : */
17325 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17326 :
17327 : /* "View.MemoryView":1301
17328 : * if slices_overlap(&src, &dst, ndim, itemsize):
17329 : *
17330 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17331 : * order = get_best_order(&dst, ndim)
17332 : *
17333 : */
17334 : }
17335 :
17336 : /* "View.MemoryView":1304
17337 : * order = get_best_order(&dst, ndim)
17338 : *
17339 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17340 : * src = tmp
17341 : *
17342 : */
17343 0 : __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
17344 0 : __pyx_v_tmpdata = __pyx_t_7;
17345 :
17346 : /* "View.MemoryView":1305
17347 : *
17348 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17349 : * src = tmp # <<<<<<<<<<<<<<
17350 : *
17351 : * if not broadcasting:
17352 : */
17353 0 : __pyx_v_src = __pyx_v_tmp;
17354 :
17355 : /* "View.MemoryView":1299
17356 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17357 : *
17358 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17359 : *
17360 : * if not slice_is_contig(src, order, ndim):
17361 : */
17362 : }
17363 :
17364 : /* "View.MemoryView":1307
17365 : * src = tmp
17366 : *
17367 : * if not broadcasting: # <<<<<<<<<<<<<<
17368 : *
17369 : *
17370 : */
17371 0 : __pyx_t_2 = (!__pyx_v_broadcasting);
17372 0 : if (__pyx_t_2) {
17373 :
17374 : /* "View.MemoryView":1310
17375 : *
17376 : *
17377 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17378 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17379 : * elif slice_is_contig(src, 'F', ndim):
17380 : */
17381 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17382 0 : if (__pyx_t_2) {
17383 :
17384 : /* "View.MemoryView":1311
17385 : *
17386 : * if slice_is_contig(src, 'C', ndim):
17387 : * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17388 : * elif slice_is_contig(src, 'F', ndim):
17389 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17390 : */
17391 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17392 :
17393 : /* "View.MemoryView":1310
17394 : *
17395 : *
17396 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17397 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17398 : * elif slice_is_contig(src, 'F', ndim):
17399 : */
17400 0 : goto __pyx_L12;
17401 : }
17402 :
17403 : /* "View.MemoryView":1312
17404 : * if slice_is_contig(src, 'C', ndim):
17405 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17406 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17407 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17408 : *
17409 : */
17410 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17411 0 : if (__pyx_t_2) {
17412 :
17413 : /* "View.MemoryView":1313
17414 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17415 : * elif slice_is_contig(src, 'F', ndim):
17416 : * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17417 : *
17418 : * if direct_copy:
17419 : */
17420 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17421 :
17422 : /* "View.MemoryView":1312
17423 : * if slice_is_contig(src, 'C', ndim):
17424 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17425 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17426 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17427 : *
17428 : */
17429 : }
17430 0 : __pyx_L12:;
17431 :
17432 : /* "View.MemoryView":1315
17433 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17434 : *
17435 : * if direct_copy: # <<<<<<<<<<<<<<
17436 : *
17437 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17438 : */
17439 0 : if (__pyx_v_direct_copy) {
17440 :
17441 : /* "View.MemoryView":1317
17442 : * if direct_copy:
17443 : *
17444 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17445 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17446 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17447 : */
17448 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17449 :
17450 : /* "View.MemoryView":1318
17451 : *
17452 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17453 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17454 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17455 : * free(tmpdata)
17456 : */
17457 0 : (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17458 :
17459 : /* "View.MemoryView":1319
17460 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17461 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17462 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17463 : * free(tmpdata)
17464 : * return 0
17465 : */
17466 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17467 :
17468 : /* "View.MemoryView":1320
17469 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17470 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17471 : * free(tmpdata) # <<<<<<<<<<<<<<
17472 : * return 0
17473 : *
17474 : */
17475 0 : free(__pyx_v_tmpdata);
17476 :
17477 : /* "View.MemoryView":1321
17478 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17479 : * free(tmpdata)
17480 : * return 0 # <<<<<<<<<<<<<<
17481 : *
17482 : * if order == 'F' == get_best_order(&dst, ndim):
17483 : */
17484 0 : __pyx_r = 0;
17485 0 : goto __pyx_L0;
17486 :
17487 : /* "View.MemoryView":1315
17488 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17489 : *
17490 : * if direct_copy: # <<<<<<<<<<<<<<
17491 : *
17492 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17493 : */
17494 : }
17495 :
17496 : /* "View.MemoryView":1307
17497 : * src = tmp
17498 : *
17499 : * if not broadcasting: # <<<<<<<<<<<<<<
17500 : *
17501 : *
17502 : */
17503 : }
17504 :
17505 : /* "View.MemoryView":1323
17506 : * return 0
17507 : *
17508 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17509 : *
17510 : *
17511 : */
17512 0 : __pyx_t_2 = (__pyx_v_order == 'F');
17513 0 : if (__pyx_t_2) {
17514 0 : __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17515 : }
17516 0 : if (__pyx_t_2) {
17517 :
17518 : /* "View.MemoryView":1326
17519 : *
17520 : *
17521 : * transpose_memslice(&src) # <<<<<<<<<<<<<<
17522 : * transpose_memslice(&dst)
17523 : *
17524 : */
17525 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
17526 :
17527 : /* "View.MemoryView":1327
17528 : *
17529 : * transpose_memslice(&src)
17530 : * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17531 : *
17532 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17533 : */
17534 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
17535 :
17536 : /* "View.MemoryView":1323
17537 : * return 0
17538 : *
17539 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17540 : *
17541 : *
17542 : */
17543 : }
17544 :
17545 : /* "View.MemoryView":1329
17546 : * transpose_memslice(&dst)
17547 : *
17548 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17549 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17550 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17551 : */
17552 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17553 :
17554 : /* "View.MemoryView":1330
17555 : *
17556 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17557 : * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17558 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17559 : *
17560 : */
17561 0 : copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17562 :
17563 : /* "View.MemoryView":1331
17564 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17565 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17566 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17567 : *
17568 : * free(tmpdata)
17569 : */
17570 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17571 :
17572 : /* "View.MemoryView":1333
17573 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17574 : *
17575 : * free(tmpdata) # <<<<<<<<<<<<<<
17576 : * return 0
17577 : *
17578 : */
17579 0 : free(__pyx_v_tmpdata);
17580 :
17581 : /* "View.MemoryView":1334
17582 : *
17583 : * free(tmpdata)
17584 : * return 0 # <<<<<<<<<<<<<<
17585 : *
17586 : * @cname('__pyx_memoryview_broadcast_leading')
17587 : */
17588 0 : __pyx_r = 0;
17589 0 : goto __pyx_L0;
17590 :
17591 : /* "View.MemoryView":1265
17592 : *
17593 : * @cname('__pyx_memoryview_copy_contents')
17594 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17595 : * __Pyx_memviewslice dst,
17596 : * int src_ndim, int dst_ndim,
17597 : */
17598 :
17599 : /* function exit code */
17600 0 : __pyx_L1_error:;
17601 : #ifdef WITH_THREAD
17602 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17603 : #endif
17604 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17605 0 : __pyx_r = -1;
17606 : #ifdef WITH_THREAD
17607 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17608 : #endif
17609 0 : __pyx_L0:;
17610 0 : return __pyx_r;
17611 : }
17612 :
17613 : /* "View.MemoryView":1337
17614 : *
17615 : * @cname('__pyx_memoryview_broadcast_leading')
17616 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17617 : * int ndim,
17618 : * int ndim_other) noexcept nogil:
17619 : */
17620 :
17621 0 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17622 0 : int __pyx_v_i;
17623 0 : int __pyx_v_offset;
17624 0 : int __pyx_t_1;
17625 0 : int __pyx_t_2;
17626 0 : int __pyx_t_3;
17627 :
17628 : /* "View.MemoryView":1341
17629 : * int ndim_other) noexcept nogil:
17630 : * cdef int i
17631 : * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17632 : *
17633 : * for i in range(ndim - 1, -1, -1):
17634 : */
17635 0 : __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17636 :
17637 : /* "View.MemoryView":1343
17638 : * cdef int offset = ndim_other - ndim
17639 : *
17640 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17641 : * mslice.shape[i + offset] = mslice.shape[i]
17642 : * mslice.strides[i + offset] = mslice.strides[i]
17643 : */
17644 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17645 0 : __pyx_v_i = __pyx_t_1;
17646 :
17647 : /* "View.MemoryView":1344
17648 : *
17649 : * for i in range(ndim - 1, -1, -1):
17650 : * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17651 : * mslice.strides[i + offset] = mslice.strides[i]
17652 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17653 : */
17654 0 : (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17655 :
17656 : /* "View.MemoryView":1345
17657 : * for i in range(ndim - 1, -1, -1):
17658 : * mslice.shape[i + offset] = mslice.shape[i]
17659 : * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17660 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17661 : *
17662 : */
17663 0 : (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17664 :
17665 : /* "View.MemoryView":1346
17666 : * mslice.shape[i + offset] = mslice.shape[i]
17667 : * mslice.strides[i + offset] = mslice.strides[i]
17668 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17669 : *
17670 : * for i in range(offset):
17671 : */
17672 0 : (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17673 : }
17674 :
17675 : /* "View.MemoryView":1348
17676 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17677 : *
17678 : * for i in range(offset): # <<<<<<<<<<<<<<
17679 : * mslice.shape[i] = 1
17680 : * mslice.strides[i] = mslice.strides[0]
17681 : */
17682 0 : __pyx_t_1 = __pyx_v_offset;
17683 : __pyx_t_2 = __pyx_t_1;
17684 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17685 0 : __pyx_v_i = __pyx_t_3;
17686 :
17687 : /* "View.MemoryView":1349
17688 : *
17689 : * for i in range(offset):
17690 : * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17691 : * mslice.strides[i] = mslice.strides[0]
17692 : * mslice.suboffsets[i] = -1
17693 : */
17694 0 : (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17695 :
17696 : /* "View.MemoryView":1350
17697 : * for i in range(offset):
17698 : * mslice.shape[i] = 1
17699 : * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
17700 : * mslice.suboffsets[i] = -1
17701 : *
17702 : */
17703 0 : (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17704 :
17705 : /* "View.MemoryView":1351
17706 : * mslice.shape[i] = 1
17707 : * mslice.strides[i] = mslice.strides[0]
17708 : * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17709 : *
17710 : *
17711 : */
17712 0 : (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17713 : }
17714 :
17715 : /* "View.MemoryView":1337
17716 : *
17717 : * @cname('__pyx_memoryview_broadcast_leading')
17718 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17719 : * int ndim,
17720 : * int ndim_other) noexcept nogil:
17721 : */
17722 :
17723 : /* function exit code */
17724 0 : }
17725 :
17726 : /* "View.MemoryView":1359
17727 : *
17728 : * @cname('__pyx_memoryview_refcount_copying')
17729 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17730 : *
17731 : * if dtype_is_object:
17732 : */
17733 :
17734 0 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
17735 :
17736 : /* "View.MemoryView":1361
17737 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17738 : *
17739 : * if dtype_is_object: # <<<<<<<<<<<<<<
17740 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17741 : *
17742 : */
17743 0 : if (__pyx_v_dtype_is_object) {
17744 :
17745 : /* "View.MemoryView":1362
17746 : *
17747 : * if dtype_is_object:
17748 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
17749 : *
17750 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17751 : */
17752 0 : __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
17753 :
17754 : /* "View.MemoryView":1361
17755 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17756 : *
17757 : * if dtype_is_object: # <<<<<<<<<<<<<<
17758 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17759 : *
17760 : */
17761 : }
17762 :
17763 : /* "View.MemoryView":1359
17764 : *
17765 : * @cname('__pyx_memoryview_refcount_copying')
17766 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17767 : *
17768 : * if dtype_is_object:
17769 : */
17770 :
17771 : /* function exit code */
17772 0 : }
17773 :
17774 : /* "View.MemoryView":1365
17775 : *
17776 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17777 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17778 : * Py_ssize_t *strides, int ndim,
17779 : * bint inc) noexcept with gil:
17780 : */
17781 :
17782 0 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17783 : #ifdef WITH_THREAD
17784 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17785 : #endif
17786 :
17787 : /* "View.MemoryView":1368
17788 : * Py_ssize_t *strides, int ndim,
17789 : * bint inc) noexcept with gil:
17790 : * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
17791 : *
17792 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17793 : */
17794 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17795 :
17796 : /* "View.MemoryView":1365
17797 : *
17798 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17799 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17800 : * Py_ssize_t *strides, int ndim,
17801 : * bint inc) noexcept with gil:
17802 : */
17803 :
17804 : /* function exit code */
17805 : #ifdef WITH_THREAD
17806 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17807 : #endif
17808 0 : }
17809 :
17810 : /* "View.MemoryView":1371
17811 : *
17812 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17813 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17814 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17815 : * cdef Py_ssize_t i
17816 : */
17817 :
17818 0 : static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17819 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17820 0 : Py_ssize_t __pyx_v_stride;
17821 0 : Py_ssize_t __pyx_t_1;
17822 0 : Py_ssize_t __pyx_t_2;
17823 0 : Py_ssize_t __pyx_t_3;
17824 0 : int __pyx_t_4;
17825 :
17826 : /* "View.MemoryView":1374
17827 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17828 : * cdef Py_ssize_t i
17829 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17830 : *
17831 : * for i in range(shape[0]):
17832 : */
17833 0 : __pyx_v_stride = (__pyx_v_strides[0]);
17834 :
17835 : /* "View.MemoryView":1376
17836 : * cdef Py_ssize_t stride = strides[0]
17837 : *
17838 : * for i in range(shape[0]): # <<<<<<<<<<<<<<
17839 : * if ndim == 1:
17840 : * if inc:
17841 : */
17842 0 : __pyx_t_1 = (__pyx_v_shape[0]);
17843 0 : __pyx_t_2 = __pyx_t_1;
17844 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17845 0 : __pyx_v_i = __pyx_t_3;
17846 :
17847 : /* "View.MemoryView":1377
17848 : *
17849 : * for i in range(shape[0]):
17850 : * if ndim == 1: # <<<<<<<<<<<<<<
17851 : * if inc:
17852 : * Py_INCREF((<PyObject **> data)[0])
17853 : */
17854 0 : __pyx_t_4 = (__pyx_v_ndim == 1);
17855 0 : if (__pyx_t_4) {
17856 :
17857 : /* "View.MemoryView":1378
17858 : * for i in range(shape[0]):
17859 : * if ndim == 1:
17860 : * if inc: # <<<<<<<<<<<<<<
17861 : * Py_INCREF((<PyObject **> data)[0])
17862 : * else:
17863 : */
17864 0 : if (__pyx_v_inc) {
17865 :
17866 : /* "View.MemoryView":1379
17867 : * if ndim == 1:
17868 : * if inc:
17869 : * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17870 : * else:
17871 : * Py_DECREF((<PyObject **> data)[0])
17872 : */
17873 0 : Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17874 :
17875 : /* "View.MemoryView":1378
17876 : * for i in range(shape[0]):
17877 : * if ndim == 1:
17878 : * if inc: # <<<<<<<<<<<<<<
17879 : * Py_INCREF((<PyObject **> data)[0])
17880 : * else:
17881 : */
17882 0 : goto __pyx_L6;
17883 : }
17884 :
17885 : /* "View.MemoryView":1381
17886 : * Py_INCREF((<PyObject **> data)[0])
17887 : * else:
17888 : * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17889 : * else:
17890 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17891 : */
17892 : /*else*/ {
17893 0 : Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17894 : }
17895 0 : __pyx_L6:;
17896 :
17897 : /* "View.MemoryView":1377
17898 : *
17899 : * for i in range(shape[0]):
17900 : * if ndim == 1: # <<<<<<<<<<<<<<
17901 : * if inc:
17902 : * Py_INCREF((<PyObject **> data)[0])
17903 : */
17904 0 : goto __pyx_L5;
17905 : }
17906 :
17907 : /* "View.MemoryView":1383
17908 : * Py_DECREF((<PyObject **> data)[0])
17909 : * else:
17910 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
17911 : *
17912 : * data += stride
17913 : */
17914 : /*else*/ {
17915 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
17916 : }
17917 0 : __pyx_L5:;
17918 :
17919 : /* "View.MemoryView":1385
17920 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17921 : *
17922 : * data += stride # <<<<<<<<<<<<<<
17923 : *
17924 : *
17925 : */
17926 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17927 : }
17928 :
17929 : /* "View.MemoryView":1371
17930 : *
17931 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17932 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17933 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17934 : * cdef Py_ssize_t i
17935 : */
17936 :
17937 : /* function exit code */
17938 0 : }
17939 :
17940 : /* "View.MemoryView":1391
17941 : *
17942 : * @cname('__pyx_memoryview_slice_assign_scalar')
17943 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17944 : * size_t itemsize, void *item,
17945 : * bint dtype_is_object) noexcept nogil:
17946 : */
17947 :
17948 0 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
17949 :
17950 : /* "View.MemoryView":1394
17951 : * size_t itemsize, void *item,
17952 : * bint dtype_is_object) noexcept nogil:
17953 : * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17954 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17955 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17956 : */
17957 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17958 :
17959 : /* "View.MemoryView":1395
17960 : * bint dtype_is_object) noexcept nogil:
17961 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17962 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
17963 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17964 : *
17965 : */
17966 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
17967 :
17968 : /* "View.MemoryView":1396
17969 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17970 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17971 : * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17972 : *
17973 : *
17974 : */
17975 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17976 :
17977 : /* "View.MemoryView":1391
17978 : *
17979 : * @cname('__pyx_memoryview_slice_assign_scalar')
17980 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17981 : * size_t itemsize, void *item,
17982 : * bint dtype_is_object) noexcept nogil:
17983 : */
17984 :
17985 : /* function exit code */
17986 0 : }
17987 :
17988 : /* "View.MemoryView":1400
17989 : *
17990 : * @cname('__pyx_memoryview__slice_assign_scalar')
17991 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17992 : * Py_ssize_t *strides, int ndim,
17993 : * size_t itemsize, void *item) noexcept nogil:
17994 : */
17995 :
17996 0 : static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
17997 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17998 0 : Py_ssize_t __pyx_v_stride;
17999 0 : Py_ssize_t __pyx_v_extent;
18000 0 : int __pyx_t_1;
18001 0 : Py_ssize_t __pyx_t_2;
18002 0 : Py_ssize_t __pyx_t_3;
18003 0 : Py_ssize_t __pyx_t_4;
18004 :
18005 : /* "View.MemoryView":1404
18006 : * size_t itemsize, void *item) noexcept nogil:
18007 : * cdef Py_ssize_t i
18008 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18009 : * cdef Py_ssize_t extent = shape[0]
18010 : *
18011 : */
18012 0 : __pyx_v_stride = (__pyx_v_strides[0]);
18013 :
18014 : /* "View.MemoryView":1405
18015 : * cdef Py_ssize_t i
18016 : * cdef Py_ssize_t stride = strides[0]
18017 : * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18018 : *
18019 : * if ndim == 1:
18020 : */
18021 0 : __pyx_v_extent = (__pyx_v_shape[0]);
18022 :
18023 : /* "View.MemoryView":1407
18024 : * cdef Py_ssize_t extent = shape[0]
18025 : *
18026 : * if ndim == 1: # <<<<<<<<<<<<<<
18027 : * for i in range(extent):
18028 : * memcpy(data, item, itemsize)
18029 : */
18030 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
18031 0 : if (__pyx_t_1) {
18032 :
18033 : /* "View.MemoryView":1408
18034 : *
18035 : * if ndim == 1:
18036 : * for i in range(extent): # <<<<<<<<<<<<<<
18037 : * memcpy(data, item, itemsize)
18038 : * data += stride
18039 : */
18040 : __pyx_t_2 = __pyx_v_extent;
18041 : __pyx_t_3 = __pyx_t_2;
18042 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18043 0 : __pyx_v_i = __pyx_t_4;
18044 :
18045 : /* "View.MemoryView":1409
18046 : * if ndim == 1:
18047 : * for i in range(extent):
18048 : * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18049 : * data += stride
18050 : * else:
18051 : */
18052 0 : (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18053 :
18054 : /* "View.MemoryView":1410
18055 : * for i in range(extent):
18056 : * memcpy(data, item, itemsize)
18057 : * data += stride # <<<<<<<<<<<<<<
18058 : * else:
18059 : * for i in range(extent):
18060 : */
18061 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18062 : }
18063 :
18064 : /* "View.MemoryView":1407
18065 : * cdef Py_ssize_t extent = shape[0]
18066 : *
18067 : * if ndim == 1: # <<<<<<<<<<<<<<
18068 : * for i in range(extent):
18069 : * memcpy(data, item, itemsize)
18070 : */
18071 0 : goto __pyx_L3;
18072 : }
18073 :
18074 : /* "View.MemoryView":1412
18075 : * data += stride
18076 : * else:
18077 : * for i in range(extent): # <<<<<<<<<<<<<<
18078 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18079 : * data += stride
18080 : */
18081 : /*else*/ {
18082 : __pyx_t_2 = __pyx_v_extent;
18083 : __pyx_t_3 = __pyx_t_2;
18084 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18085 0 : __pyx_v_i = __pyx_t_4;
18086 :
18087 : /* "View.MemoryView":1413
18088 : * else:
18089 : * for i in range(extent):
18090 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18091 : * data += stride
18092 : *
18093 : */
18094 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18095 :
18096 : /* "View.MemoryView":1414
18097 : * for i in range(extent):
18098 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18099 : * data += stride # <<<<<<<<<<<<<<
18100 : *
18101 : *
18102 : */
18103 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18104 : }
18105 : }
18106 0 : __pyx_L3:;
18107 :
18108 : /* "View.MemoryView":1400
18109 : *
18110 : * @cname('__pyx_memoryview__slice_assign_scalar')
18111 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18112 : * Py_ssize_t *strides, int ndim,
18113 : * size_t itemsize, void *item) noexcept nogil:
18114 : */
18115 :
18116 : /* function exit code */
18117 0 : }
18118 :
18119 : /* "(tree fragment)":1
18120 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18121 : * cdef object __pyx_PickleError
18122 : * cdef object __pyx_result
18123 : */
18124 :
18125 : /* Python wrapper */
18126 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18127 : #if CYTHON_METH_FASTCALL
18128 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18129 : #else
18130 : PyObject *__pyx_args, PyObject *__pyx_kwds
18131 : #endif
18132 : ); /*proto*/
18133 : static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18134 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18135 : #if CYTHON_METH_FASTCALL
18136 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18137 : #else
18138 : PyObject *__pyx_args, PyObject *__pyx_kwds
18139 : #endif
18140 : ) {
18141 0 : PyObject *__pyx_v___pyx_type = 0;
18142 0 : long __pyx_v___pyx_checksum;
18143 0 : PyObject *__pyx_v___pyx_state = 0;
18144 : #if !CYTHON_METH_FASTCALL
18145 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18146 : #endif
18147 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18148 0 : PyObject* values[3] = {0,0,0};
18149 0 : int __pyx_lineno = 0;
18150 0 : const char *__pyx_filename = NULL;
18151 0 : int __pyx_clineno = 0;
18152 0 : PyObject *__pyx_r = 0;
18153 : __Pyx_RefNannyDeclarations
18154 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18155 : #if !CYTHON_METH_FASTCALL
18156 : #if CYTHON_ASSUME_SAFE_MACROS
18157 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18158 : #else
18159 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18160 : #endif
18161 : #endif
18162 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18163 : {
18164 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18165 0 : if (__pyx_kwds) {
18166 0 : Py_ssize_t kw_args;
18167 0 : switch (__pyx_nargs) {
18168 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18169 0 : CYTHON_FALLTHROUGH;
18170 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18171 0 : CYTHON_FALLTHROUGH;
18172 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18173 0 : CYTHON_FALLTHROUGH;
18174 0 : case 0: break;
18175 0 : default: goto __pyx_L5_argtuple_error;
18176 : }
18177 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
18178 0 : switch (__pyx_nargs) {
18179 0 : case 0:
18180 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
18181 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
18182 0 : kw_args--;
18183 : }
18184 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18185 0 : else goto __pyx_L5_argtuple_error;
18186 0 : CYTHON_FALLTHROUGH;
18187 : case 1:
18188 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
18189 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
18190 0 : kw_args--;
18191 : }
18192 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18193 : else {
18194 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
18195 : }
18196 0 : CYTHON_FALLTHROUGH;
18197 : case 2:
18198 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
18199 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
18200 0 : kw_args--;
18201 : }
18202 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18203 : else {
18204 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
18205 : }
18206 : }
18207 0 : if (unlikely(kw_args > 0)) {
18208 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
18209 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
18210 : }
18211 0 : } else if (unlikely(__pyx_nargs != 3)) {
18212 0 : goto __pyx_L5_argtuple_error;
18213 : } else {
18214 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18215 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18216 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18217 : }
18218 0 : __pyx_v___pyx_type = values[0];
18219 0 : __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18220 0 : __pyx_v___pyx_state = values[2];
18221 : }
18222 0 : goto __pyx_L6_skip;
18223 0 : __pyx_L5_argtuple_error:;
18224 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
18225 0 : __pyx_L6_skip:;
18226 0 : goto __pyx_L4_argument_unpacking_done;
18227 0 : __pyx_L3_error:;
18228 : {
18229 0 : Py_ssize_t __pyx_temp;
18230 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18231 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18232 : }
18233 : }
18234 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18235 0 : __Pyx_RefNannyFinishContext();
18236 0 : return NULL;
18237 0 : __pyx_L4_argument_unpacking_done:;
18238 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18239 :
18240 : /* function exit code */
18241 : {
18242 0 : Py_ssize_t __pyx_temp;
18243 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18244 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18245 : }
18246 : }
18247 : __Pyx_RefNannyFinishContext();
18248 : return __pyx_r;
18249 : }
18250 :
18251 0 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18252 0 : PyObject *__pyx_v___pyx_PickleError = 0;
18253 0 : PyObject *__pyx_v___pyx_result = 0;
18254 0 : PyObject *__pyx_r = NULL;
18255 : __Pyx_RefNannyDeclarations
18256 0 : PyObject *__pyx_t_1 = NULL;
18257 0 : int __pyx_t_2;
18258 0 : PyObject *__pyx_t_3 = NULL;
18259 0 : PyObject *__pyx_t_4 = NULL;
18260 0 : unsigned int __pyx_t_5;
18261 0 : int __pyx_lineno = 0;
18262 0 : const char *__pyx_filename = NULL;
18263 0 : int __pyx_clineno = 0;
18264 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);
18265 :
18266 : /* "(tree fragment)":4
18267 : * cdef object __pyx_PickleError
18268 : * cdef object __pyx_result
18269 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18270 : * from pickle import PickleError as __pyx_PickleError
18271 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18272 : */
18273 0 : __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18274 0 : __Pyx_GOTREF(__pyx_t_1);
18275 0 : __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
18276 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18277 0 : if (__pyx_t_2) {
18278 :
18279 : /* "(tree fragment)":5
18280 : * cdef object __pyx_result
18281 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18282 : * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
18283 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18284 : * __pyx_result = Enum.__new__(__pyx_type)
18285 : */
18286 0 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18287 0 : __Pyx_GOTREF(__pyx_t_1);
18288 0 : __Pyx_INCREF(__pyx_n_s_PickleError);
18289 0 : __Pyx_GIVEREF(__pyx_n_s_PickleError);
18290 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
18291 0 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
18292 0 : __Pyx_GOTREF(__pyx_t_3);
18293 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18294 0 : __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18295 0 : __Pyx_GOTREF(__pyx_t_1);
18296 0 : __Pyx_INCREF(__pyx_t_1);
18297 0 : __pyx_v___pyx_PickleError = __pyx_t_1;
18298 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18299 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18300 :
18301 : /* "(tree fragment)":6
18302 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18303 : * from pickle import PickleError as __pyx_PickleError
18304 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
18305 : * __pyx_result = Enum.__new__(__pyx_type)
18306 : * if __pyx_state is not None:
18307 : */
18308 0 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
18309 0 : __Pyx_GOTREF(__pyx_t_3);
18310 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
18311 0 : __Pyx_GOTREF(__pyx_t_1);
18312 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18313 0 : __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
18314 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18315 0 : __PYX_ERR(1, 6, __pyx_L1_error)
18316 :
18317 : /* "(tree fragment)":4
18318 : * cdef object __pyx_PickleError
18319 : * cdef object __pyx_result
18320 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18321 : * from pickle import PickleError as __pyx_PickleError
18322 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18323 : */
18324 : }
18325 :
18326 : /* "(tree fragment)":7
18327 : * from pickle import PickleError as __pyx_PickleError
18328 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18329 : * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18330 : * if __pyx_state is not None:
18331 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18332 : */
18333 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
18334 0 : __Pyx_GOTREF(__pyx_t_3);
18335 0 : __pyx_t_4 = NULL;
18336 0 : __pyx_t_5 = 0;
18337 : #if CYTHON_UNPACK_METHODS
18338 0 : if (likely(PyMethod_Check(__pyx_t_3))) {
18339 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
18340 0 : if (likely(__pyx_t_4)) {
18341 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18342 0 : __Pyx_INCREF(__pyx_t_4);
18343 0 : __Pyx_INCREF(function);
18344 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
18345 : __pyx_t_5 = 1;
18346 : }
18347 : }
18348 : #endif
18349 : {
18350 0 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
18351 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
18352 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18353 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
18354 0 : __Pyx_GOTREF(__pyx_t_1);
18355 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18356 : }
18357 0 : __pyx_v___pyx_result = __pyx_t_1;
18358 0 : __pyx_t_1 = 0;
18359 :
18360 : /* "(tree fragment)":8
18361 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18362 : * __pyx_result = Enum.__new__(__pyx_type)
18363 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18364 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18365 : * return __pyx_result
18366 : */
18367 0 : __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
18368 0 : if (__pyx_t_2) {
18369 :
18370 : /* "(tree fragment)":9
18371 : * __pyx_result = Enum.__new__(__pyx_type)
18372 : * if __pyx_state is not None:
18373 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18374 : * return __pyx_result
18375 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18376 : */
18377 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
18378 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
18379 0 : __Pyx_GOTREF(__pyx_t_1);
18380 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18381 :
18382 : /* "(tree fragment)":8
18383 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18384 : * __pyx_result = Enum.__new__(__pyx_type)
18385 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18386 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18387 : * return __pyx_result
18388 : */
18389 : }
18390 :
18391 : /* "(tree fragment)":10
18392 : * if __pyx_state is not None:
18393 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18394 : * return __pyx_result # <<<<<<<<<<<<<<
18395 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18396 : * __pyx_result.name = __pyx_state[0]
18397 : */
18398 0 : __Pyx_XDECREF(__pyx_r);
18399 0 : __Pyx_INCREF(__pyx_v___pyx_result);
18400 0 : __pyx_r = __pyx_v___pyx_result;
18401 0 : goto __pyx_L0;
18402 :
18403 : /* "(tree fragment)":1
18404 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18405 : * cdef object __pyx_PickleError
18406 : * cdef object __pyx_result
18407 : */
18408 :
18409 : /* function exit code */
18410 0 : __pyx_L1_error:;
18411 0 : __Pyx_XDECREF(__pyx_t_1);
18412 0 : __Pyx_XDECREF(__pyx_t_3);
18413 0 : __Pyx_XDECREF(__pyx_t_4);
18414 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18415 0 : __pyx_r = NULL;
18416 0 : __pyx_L0:;
18417 0 : __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18418 0 : __Pyx_XDECREF(__pyx_v___pyx_result);
18419 0 : __Pyx_XGIVEREF(__pyx_r);
18420 0 : __Pyx_RefNannyFinishContext();
18421 0 : return __pyx_r;
18422 : }
18423 :
18424 : /* "(tree fragment)":11
18425 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18426 : * return __pyx_result
18427 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18428 : * __pyx_result.name = __pyx_state[0]
18429 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18430 : */
18431 :
18432 0 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18433 0 : PyObject *__pyx_r = NULL;
18434 : __Pyx_RefNannyDeclarations
18435 0 : PyObject *__pyx_t_1 = NULL;
18436 0 : int __pyx_t_2;
18437 0 : Py_ssize_t __pyx_t_3;
18438 0 : int __pyx_t_4;
18439 0 : PyObject *__pyx_t_5 = NULL;
18440 0 : PyObject *__pyx_t_6 = NULL;
18441 0 : PyObject *__pyx_t_7 = NULL;
18442 0 : unsigned int __pyx_t_8;
18443 0 : int __pyx_lineno = 0;
18444 0 : const char *__pyx_filename = NULL;
18445 0 : int __pyx_clineno = 0;
18446 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);
18447 :
18448 : /* "(tree fragment)":12
18449 : * return __pyx_result
18450 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18451 : * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18452 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18453 : * __pyx_result.__dict__.update(__pyx_state[1])
18454 : */
18455 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18456 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18457 0 : __PYX_ERR(1, 12, __pyx_L1_error)
18458 : }
18459 0 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18460 0 : __Pyx_GOTREF(__pyx_t_1);
18461 0 : __Pyx_GIVEREF(__pyx_t_1);
18462 0 : __Pyx_GOTREF(__pyx_v___pyx_result->name);
18463 0 : __Pyx_DECREF(__pyx_v___pyx_result->name);
18464 0 : __pyx_v___pyx_result->name = __pyx_t_1;
18465 0 : __pyx_t_1 = 0;
18466 :
18467 : /* "(tree fragment)":13
18468 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18469 : * __pyx_result.name = __pyx_state[0]
18470 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18471 : * __pyx_result.__dict__.update(__pyx_state[1])
18472 : */
18473 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18474 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
18475 : __PYX_ERR(1, 13, __pyx_L1_error)
18476 : }
18477 0 : __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18478 0 : __pyx_t_4 = (__pyx_t_3 > 1);
18479 0 : if (__pyx_t_4) {
18480 0 : } else {
18481 0 : __pyx_t_2 = __pyx_t_4;
18482 0 : goto __pyx_L4_bool_binop_done;
18483 : }
18484 0 : __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18485 : __pyx_t_2 = __pyx_t_4;
18486 0 : __pyx_L4_bool_binop_done:;
18487 0 : if (__pyx_t_2) {
18488 :
18489 : /* "(tree fragment)":14
18490 : * __pyx_result.name = __pyx_state[0]
18491 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18492 : * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
18493 : */
18494 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18495 0 : __Pyx_GOTREF(__pyx_t_5);
18496 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
18497 0 : __Pyx_GOTREF(__pyx_t_6);
18498 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18499 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18500 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18501 : __PYX_ERR(1, 14, __pyx_L1_error)
18502 : }
18503 0 : __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18504 0 : __Pyx_GOTREF(__pyx_t_5);
18505 0 : __pyx_t_7 = NULL;
18506 0 : __pyx_t_8 = 0;
18507 : #if CYTHON_UNPACK_METHODS
18508 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
18509 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
18510 0 : if (likely(__pyx_t_7)) {
18511 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
18512 0 : __Pyx_INCREF(__pyx_t_7);
18513 0 : __Pyx_INCREF(function);
18514 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
18515 : __pyx_t_8 = 1;
18516 : }
18517 : }
18518 : #endif
18519 : {
18520 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
18521 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
18522 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18523 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18524 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
18525 0 : __Pyx_GOTREF(__pyx_t_1);
18526 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18527 : }
18528 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18529 :
18530 : /* "(tree fragment)":13
18531 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18532 : * __pyx_result.name = __pyx_state[0]
18533 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18534 : * __pyx_result.__dict__.update(__pyx_state[1])
18535 : */
18536 : }
18537 :
18538 : /* "(tree fragment)":11
18539 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18540 : * return __pyx_result
18541 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18542 : * __pyx_result.name = __pyx_state[0]
18543 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18544 : */
18545 :
18546 : /* function exit code */
18547 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18548 0 : goto __pyx_L0;
18549 0 : __pyx_L1_error:;
18550 0 : __Pyx_XDECREF(__pyx_t_1);
18551 0 : __Pyx_XDECREF(__pyx_t_5);
18552 0 : __Pyx_XDECREF(__pyx_t_6);
18553 0 : __Pyx_XDECREF(__pyx_t_7);
18554 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18555 0 : __pyx_r = 0;
18556 0 : __pyx_L0:;
18557 0 : __Pyx_XGIVEREF(__pyx_r);
18558 0 : __Pyx_RefNannyFinishContext();
18559 0 : return __pyx_r;
18560 : }
18561 :
18562 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18563 : *
18564 : * @property
18565 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18566 : * return PyDataType_ELSIZE(self)
18567 : *
18568 : */
18569 :
18570 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
18571 : npy_intp __pyx_r;
18572 :
18573 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
18574 : * @property
18575 : * cdef inline npy_intp itemsize(self) noexcept nogil:
18576 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
18577 : *
18578 : * @property
18579 : */
18580 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
18581 : goto __pyx_L0;
18582 :
18583 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18584 : *
18585 : * @property
18586 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18587 : * return PyDataType_ELSIZE(self)
18588 : *
18589 : */
18590 :
18591 : /* function exit code */
18592 : __pyx_L0:;
18593 : return __pyx_r;
18594 : }
18595 :
18596 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18597 : *
18598 : * @property
18599 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18600 : * return PyDataType_ALIGNMENT(self)
18601 : *
18602 : */
18603 :
18604 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
18605 : npy_intp __pyx_r;
18606 :
18607 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
18608 : * @property
18609 : * cdef inline npy_intp alignment(self) noexcept nogil:
18610 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
18611 : *
18612 : * # Use fields/names with care as they may be NULL. You must check
18613 : */
18614 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
18615 : goto __pyx_L0;
18616 :
18617 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18618 : *
18619 : * @property
18620 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18621 : * return PyDataType_ALIGNMENT(self)
18622 : *
18623 : */
18624 :
18625 : /* function exit code */
18626 : __pyx_L0:;
18627 : return __pyx_r;
18628 : }
18629 :
18630 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18631 : * # for this using PyDataType_HASFIELDS.
18632 : * @property
18633 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18634 : * return <object>PyDataType_FIELDS(self)
18635 : *
18636 : */
18637 :
18638 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
18639 : PyObject *__pyx_r = NULL;
18640 : __Pyx_RefNannyDeclarations
18641 : PyObject *__pyx_t_1;
18642 : __Pyx_RefNannySetupContext("fields", 1);
18643 :
18644 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
18645 : * @property
18646 : * cdef inline object fields(self):
18647 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
18648 : *
18649 : * @property
18650 : */
18651 : __Pyx_XDECREF(__pyx_r);
18652 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
18653 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
18654 : __pyx_r = ((PyObject *)__pyx_t_1);
18655 : goto __pyx_L0;
18656 :
18657 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18658 : * # for this using PyDataType_HASFIELDS.
18659 : * @property
18660 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18661 : * return <object>PyDataType_FIELDS(self)
18662 : *
18663 : */
18664 :
18665 : /* function exit code */
18666 : __pyx_L0:;
18667 : __Pyx_XGIVEREF(__pyx_r);
18668 : __Pyx_RefNannyFinishContext();
18669 : return __pyx_r;
18670 : }
18671 :
18672 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18673 : *
18674 : * @property
18675 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18676 : * return <tuple>PyDataType_NAMES(self)
18677 : *
18678 : */
18679 :
18680 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
18681 : PyObject *__pyx_r = NULL;
18682 : __Pyx_RefNannyDeclarations
18683 : PyObject *__pyx_t_1;
18684 : __Pyx_RefNannySetupContext("names", 1);
18685 :
18686 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
18687 : * @property
18688 : * cdef inline tuple names(self):
18689 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
18690 : *
18691 : * # Use PyDataType_HASSUBARRAY to test whether this field is
18692 : */
18693 : __Pyx_XDECREF(__pyx_r);
18694 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
18695 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
18696 : __pyx_r = ((PyObject*)__pyx_t_1);
18697 : goto __pyx_L0;
18698 :
18699 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18700 : *
18701 : * @property
18702 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18703 : * return <tuple>PyDataType_NAMES(self)
18704 : *
18705 : */
18706 :
18707 : /* function exit code */
18708 : __pyx_L0:;
18709 : __Pyx_XGIVEREF(__pyx_r);
18710 : __Pyx_RefNannyFinishContext();
18711 : return __pyx_r;
18712 : }
18713 :
18714 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18715 : * # this field via the inline helper method PyDataType_SHAPE.
18716 : * @property
18717 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18718 : * return PyDataType_SUBARRAY(self)
18719 : *
18720 : */
18721 :
18722 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
18723 : PyArray_ArrayDescr *__pyx_r;
18724 :
18725 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
18726 : * @property
18727 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
18728 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
18729 : *
18730 : * @property
18731 : */
18732 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
18733 : goto __pyx_L0;
18734 :
18735 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18736 : * # this field via the inline helper method PyDataType_SHAPE.
18737 : * @property
18738 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18739 : * return PyDataType_SUBARRAY(self)
18740 : *
18741 : */
18742 :
18743 : /* function exit code */
18744 : __pyx_L0:;
18745 : return __pyx_r;
18746 : }
18747 :
18748 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18749 : *
18750 : * @property
18751 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18752 : * """The data types flags."""
18753 : * return PyDataType_FLAGS(self)
18754 : */
18755 :
18756 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
18757 : npy_uint64 __pyx_r;
18758 :
18759 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
18760 : * cdef inline npy_uint64 flags(self) noexcept nogil:
18761 : * """The data types flags."""
18762 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
18763 : *
18764 : *
18765 : */
18766 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
18767 : goto __pyx_L0;
18768 :
18769 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18770 : *
18771 : * @property
18772 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18773 : * """The data types flags."""
18774 : * return PyDataType_FLAGS(self)
18775 : */
18776 :
18777 : /* function exit code */
18778 : __pyx_L0:;
18779 : return __pyx_r;
18780 : }
18781 :
18782 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18783 : *
18784 : * @property
18785 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18786 : * """The number of arrays that need to be broadcast to the same shape."""
18787 : * return PyArray_MultiIter_NUMITER(self)
18788 : */
18789 :
18790 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
18791 : int __pyx_r;
18792 :
18793 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
18794 : * cdef inline int numiter(self) noexcept nogil:
18795 : * """The number of arrays that need to be broadcast to the same shape."""
18796 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
18797 : *
18798 : * @property
18799 : */
18800 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
18801 : goto __pyx_L0;
18802 :
18803 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18804 : *
18805 : * @property
18806 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18807 : * """The number of arrays that need to be broadcast to the same shape."""
18808 : * return PyArray_MultiIter_NUMITER(self)
18809 : */
18810 :
18811 : /* function exit code */
18812 : __pyx_L0:;
18813 : return __pyx_r;
18814 : }
18815 :
18816 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18817 : *
18818 : * @property
18819 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18820 : * """The total broadcasted size."""
18821 : * return PyArray_MultiIter_SIZE(self)
18822 : */
18823 :
18824 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
18825 : npy_intp __pyx_r;
18826 :
18827 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
18828 : * cdef inline npy_intp size(self) noexcept nogil:
18829 : * """The total broadcasted size."""
18830 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
18831 : *
18832 : * @property
18833 : */
18834 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
18835 : goto __pyx_L0;
18836 :
18837 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18838 : *
18839 : * @property
18840 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18841 : * """The total broadcasted size."""
18842 : * return PyArray_MultiIter_SIZE(self)
18843 : */
18844 :
18845 : /* function exit code */
18846 : __pyx_L0:;
18847 : return __pyx_r;
18848 : }
18849 :
18850 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18851 : *
18852 : * @property
18853 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18854 : * """The current (1-d) index into the broadcasted result."""
18855 : * return PyArray_MultiIter_INDEX(self)
18856 : */
18857 :
18858 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
18859 : npy_intp __pyx_r;
18860 :
18861 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
18862 : * cdef inline npy_intp index(self) noexcept nogil:
18863 : * """The current (1-d) index into the broadcasted result."""
18864 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
18865 : *
18866 : * @property
18867 : */
18868 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
18869 : goto __pyx_L0;
18870 :
18871 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18872 : *
18873 : * @property
18874 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18875 : * """The current (1-d) index into the broadcasted result."""
18876 : * return PyArray_MultiIter_INDEX(self)
18877 : */
18878 :
18879 : /* function exit code */
18880 : __pyx_L0:;
18881 : return __pyx_r;
18882 : }
18883 :
18884 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18885 : *
18886 : * @property
18887 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18888 : * """The number of dimensions in the broadcasted result."""
18889 : * return PyArray_MultiIter_NDIM(self)
18890 : */
18891 :
18892 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
18893 : int __pyx_r;
18894 :
18895 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
18896 : * cdef inline int nd(self) noexcept nogil:
18897 : * """The number of dimensions in the broadcasted result."""
18898 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
18899 : *
18900 : * @property
18901 : */
18902 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
18903 : goto __pyx_L0;
18904 :
18905 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18906 : *
18907 : * @property
18908 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18909 : * """The number of dimensions in the broadcasted result."""
18910 : * return PyArray_MultiIter_NDIM(self)
18911 : */
18912 :
18913 : /* function exit code */
18914 : __pyx_L0:;
18915 : return __pyx_r;
18916 : }
18917 :
18918 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18919 : *
18920 : * @property
18921 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18922 : * """The shape of the broadcasted result."""
18923 : * return PyArray_MultiIter_DIMS(self)
18924 : */
18925 :
18926 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
18927 : npy_intp *__pyx_r;
18928 :
18929 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
18930 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
18931 : * """The shape of the broadcasted result."""
18932 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
18933 : *
18934 : * @property
18935 : */
18936 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
18937 : goto __pyx_L0;
18938 :
18939 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18940 : *
18941 : * @property
18942 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18943 : * """The shape of the broadcasted result."""
18944 : * return PyArray_MultiIter_DIMS(self)
18945 : */
18946 :
18947 : /* function exit code */
18948 : __pyx_L0:;
18949 : return __pyx_r;
18950 : }
18951 :
18952 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18953 : *
18954 : * @property
18955 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18956 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18957 : * On return, the iterators are adjusted for broadcasting."""
18958 : */
18959 :
18960 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
18961 : void **__pyx_r;
18962 :
18963 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
18964 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18965 : * On return, the iterators are adjusted for broadcasting."""
18966 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
18967 : *
18968 : *
18969 : */
18970 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
18971 : goto __pyx_L0;
18972 :
18973 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18974 : *
18975 : * @property
18976 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18977 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18978 : * On return, the iterators are adjusted for broadcasting."""
18979 : */
18980 :
18981 : /* function exit code */
18982 : __pyx_L0:;
18983 : return __pyx_r;
18984 : }
18985 :
18986 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
18987 : *
18988 : * @property
18989 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
18990 : * """Returns a borrowed reference to the object owning the data/memory.
18991 : * """
18992 : */
18993 :
18994 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
18995 : PyObject *__pyx_r;
18996 :
18997 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
18998 : * """Returns a borrowed reference to the object owning the data/memory.
18999 : * """
19000 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
19001 : *
19002 : * @property
19003 : */
19004 : __pyx_r = PyArray_BASE(__pyx_v_self);
19005 : goto __pyx_L0;
19006 :
19007 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
19008 : *
19009 : * @property
19010 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
19011 : * """Returns a borrowed reference to the object owning the data/memory.
19012 : * """
19013 : */
19014 :
19015 : /* function exit code */
19016 : __pyx_L0:;
19017 : return __pyx_r;
19018 : }
19019 :
19020 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19021 : *
19022 : * @property
19023 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19024 : * """Returns an owned reference to the dtype of the array.
19025 : * """
19026 : */
19027 :
19028 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
19029 : PyArray_Descr *__pyx_r = NULL;
19030 : __Pyx_RefNannyDeclarations
19031 : PyArray_Descr *__pyx_t_1;
19032 : __Pyx_RefNannySetupContext("descr", 1);
19033 :
19034 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
19035 : * """Returns an owned reference to the dtype of the array.
19036 : * """
19037 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19038 : *
19039 : * @property
19040 : */
19041 : __Pyx_XDECREF((PyObject *)__pyx_r);
19042 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19043 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19044 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19045 : goto __pyx_L0;
19046 :
19047 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19048 : *
19049 : * @property
19050 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19051 : * """Returns an owned reference to the dtype of the array.
19052 : * """
19053 : */
19054 :
19055 : /* function exit code */
19056 : __pyx_L0:;
19057 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
19058 : __Pyx_RefNannyFinishContext();
19059 : return __pyx_r;
19060 : }
19061 :
19062 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19063 : *
19064 : * @property
19065 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19066 : * """Returns the number of dimensions in the array.
19067 : * """
19068 : */
19069 :
19070 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19071 : int __pyx_r;
19072 :
19073 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
19074 : * """Returns the number of dimensions in the array.
19075 : * """
19076 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19077 : *
19078 : * @property
19079 : */
19080 : __pyx_r = PyArray_NDIM(__pyx_v_self);
19081 : goto __pyx_L0;
19082 :
19083 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19084 : *
19085 : * @property
19086 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19087 : * """Returns the number of dimensions in the array.
19088 : * """
19089 : */
19090 :
19091 : /* function exit code */
19092 : __pyx_L0:;
19093 : return __pyx_r;
19094 : }
19095 :
19096 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19097 : *
19098 : * @property
19099 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19100 : * """Returns a pointer to the dimensions/shape of the array.
19101 : * The number of elements matches the number of dimensions of the array (ndim).
19102 : */
19103 :
19104 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19105 : npy_intp *__pyx_r;
19106 :
19107 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
19108 : * Can return NULL for 0-dimensional arrays.
19109 : * """
19110 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19111 : *
19112 : * @property
19113 : */
19114 : __pyx_r = PyArray_DIMS(__pyx_v_self);
19115 : goto __pyx_L0;
19116 :
19117 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19118 : *
19119 : * @property
19120 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19121 : * """Returns a pointer to the dimensions/shape of the array.
19122 : * The number of elements matches the number of dimensions of the array (ndim).
19123 : */
19124 :
19125 : /* function exit code */
19126 : __pyx_L0:;
19127 : return __pyx_r;
19128 : }
19129 :
19130 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19131 : *
19132 : * @property
19133 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19134 : * """Returns a pointer to the strides of the array.
19135 : * The number of elements matches the number of dimensions of the array (ndim).
19136 : */
19137 :
19138 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19139 : npy_intp *__pyx_r;
19140 :
19141 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
19142 : * The number of elements matches the number of dimensions of the array (ndim).
19143 : * """
19144 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19145 : *
19146 : * @property
19147 : */
19148 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
19149 : goto __pyx_L0;
19150 :
19151 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19152 : *
19153 : * @property
19154 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19155 : * """Returns a pointer to the strides of the array.
19156 : * The number of elements matches the number of dimensions of the array (ndim).
19157 : */
19158 :
19159 : /* function exit code */
19160 : __pyx_L0:;
19161 : return __pyx_r;
19162 : }
19163 :
19164 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19165 : *
19166 : * @property
19167 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19168 : * """Returns the total size (in number of elements) of the array.
19169 : * """
19170 : */
19171 :
19172 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19173 : npy_intp __pyx_r;
19174 :
19175 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
19176 : * """Returns the total size (in number of elements) of the array.
19177 : * """
19178 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19179 : *
19180 : * @property
19181 : */
19182 : __pyx_r = PyArray_SIZE(__pyx_v_self);
19183 : goto __pyx_L0;
19184 :
19185 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19186 : *
19187 : * @property
19188 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19189 : * """Returns the total size (in number of elements) of the array.
19190 : * """
19191 : */
19192 :
19193 : /* function exit code */
19194 : __pyx_L0:;
19195 : return __pyx_r;
19196 : }
19197 :
19198 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19199 : *
19200 : * @property
19201 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19202 : * """The pointer to the data buffer as a char*.
19203 : * This is provided for legacy reasons to avoid direct struct field access.
19204 : */
19205 :
19206 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19207 : char *__pyx_r;
19208 :
19209 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
19210 : * of `PyArray_DATA()` instead, which returns a 'void*'.
19211 : * """
19212 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19213 : *
19214 : *
19215 : */
19216 : __pyx_r = PyArray_BYTES(__pyx_v_self);
19217 : goto __pyx_L0;
19218 :
19219 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19220 : *
19221 : * @property
19222 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19223 : * """The pointer to the data buffer as a char*.
19224 : * This is provided for legacy reasons to avoid direct struct field access.
19225 : */
19226 :
19227 : /* function exit code */
19228 : __pyx_L0:;
19229 : return __pyx_r;
19230 : }
19231 :
19232 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19233 : * ctypedef long double complex clongdouble_t
19234 : *
19235 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19236 : * return PyArray_MultiIterNew(1, <void*>a)
19237 : *
19238 : */
19239 :
19240 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19241 : PyObject *__pyx_r = NULL;
19242 : __Pyx_RefNannyDeclarations
19243 : PyObject *__pyx_t_1 = NULL;
19244 : int __pyx_lineno = 0;
19245 : const char *__pyx_filename = NULL;
19246 : int __pyx_clineno = 0;
19247 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19248 :
19249 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
19250 : *
19251 : * cdef inline object PyArray_MultiIterNew1(a):
19252 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19253 : *
19254 : * cdef inline object PyArray_MultiIterNew2(a, b):
19255 : */
19256 : __Pyx_XDECREF(__pyx_r);
19257 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
19258 : __Pyx_GOTREF(__pyx_t_1);
19259 : __pyx_r = __pyx_t_1;
19260 : __pyx_t_1 = 0;
19261 : goto __pyx_L0;
19262 :
19263 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19264 : * ctypedef long double complex clongdouble_t
19265 : *
19266 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19267 : * return PyArray_MultiIterNew(1, <void*>a)
19268 : *
19269 : */
19270 :
19271 : /* function exit code */
19272 : __pyx_L1_error:;
19273 : __Pyx_XDECREF(__pyx_t_1);
19274 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19275 : __pyx_r = 0;
19276 : __pyx_L0:;
19277 : __Pyx_XGIVEREF(__pyx_r);
19278 : __Pyx_RefNannyFinishContext();
19279 : return __pyx_r;
19280 : }
19281 :
19282 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19283 : * return PyArray_MultiIterNew(1, <void*>a)
19284 : *
19285 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19286 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19287 : *
19288 : */
19289 :
19290 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19291 : PyObject *__pyx_r = NULL;
19292 : __Pyx_RefNannyDeclarations
19293 : PyObject *__pyx_t_1 = NULL;
19294 : int __pyx_lineno = 0;
19295 : const char *__pyx_filename = NULL;
19296 : int __pyx_clineno = 0;
19297 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19298 :
19299 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
19300 : *
19301 : * cdef inline object PyArray_MultiIterNew2(a, b):
19302 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19303 : *
19304 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19305 : */
19306 : __Pyx_XDECREF(__pyx_r);
19307 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error)
19308 : __Pyx_GOTREF(__pyx_t_1);
19309 : __pyx_r = __pyx_t_1;
19310 : __pyx_t_1 = 0;
19311 : goto __pyx_L0;
19312 :
19313 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19314 : * return PyArray_MultiIterNew(1, <void*>a)
19315 : *
19316 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19317 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19318 : *
19319 : */
19320 :
19321 : /* function exit code */
19322 : __pyx_L1_error:;
19323 : __Pyx_XDECREF(__pyx_t_1);
19324 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19325 : __pyx_r = 0;
19326 : __pyx_L0:;
19327 : __Pyx_XGIVEREF(__pyx_r);
19328 : __Pyx_RefNannyFinishContext();
19329 : return __pyx_r;
19330 : }
19331 :
19332 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19333 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19334 : *
19335 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19336 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19337 : *
19338 : */
19339 :
19340 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19341 : PyObject *__pyx_r = NULL;
19342 : __Pyx_RefNannyDeclarations
19343 : PyObject *__pyx_t_1 = NULL;
19344 : int __pyx_lineno = 0;
19345 : const char *__pyx_filename = NULL;
19346 : int __pyx_clineno = 0;
19347 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19348 :
19349 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
19350 : *
19351 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19352 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19353 : *
19354 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19355 : */
19356 : __Pyx_XDECREF(__pyx_r);
19357 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error)
19358 : __Pyx_GOTREF(__pyx_t_1);
19359 : __pyx_r = __pyx_t_1;
19360 : __pyx_t_1 = 0;
19361 : goto __pyx_L0;
19362 :
19363 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19364 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19365 : *
19366 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19367 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19368 : *
19369 : */
19370 :
19371 : /* function exit code */
19372 : __pyx_L1_error:;
19373 : __Pyx_XDECREF(__pyx_t_1);
19374 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19375 : __pyx_r = 0;
19376 : __pyx_L0:;
19377 : __Pyx_XGIVEREF(__pyx_r);
19378 : __Pyx_RefNannyFinishContext();
19379 : return __pyx_r;
19380 : }
19381 :
19382 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19383 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19384 : *
19385 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19386 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19387 : *
19388 : */
19389 :
19390 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19391 : PyObject *__pyx_r = NULL;
19392 : __Pyx_RefNannyDeclarations
19393 : PyObject *__pyx_t_1 = NULL;
19394 : int __pyx_lineno = 0;
19395 : const char *__pyx_filename = NULL;
19396 : int __pyx_clineno = 0;
19397 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19398 :
19399 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
19400 : *
19401 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19402 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19403 : *
19404 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19405 : */
19406 : __Pyx_XDECREF(__pyx_r);
19407 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error)
19408 : __Pyx_GOTREF(__pyx_t_1);
19409 : __pyx_r = __pyx_t_1;
19410 : __pyx_t_1 = 0;
19411 : goto __pyx_L0;
19412 :
19413 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19414 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19415 : *
19416 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19417 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19418 : *
19419 : */
19420 :
19421 : /* function exit code */
19422 : __pyx_L1_error:;
19423 : __Pyx_XDECREF(__pyx_t_1);
19424 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19425 : __pyx_r = 0;
19426 : __pyx_L0:;
19427 : __Pyx_XGIVEREF(__pyx_r);
19428 : __Pyx_RefNannyFinishContext();
19429 : return __pyx_r;
19430 : }
19431 :
19432 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19433 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19434 : *
19435 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19436 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19437 : *
19438 : */
19439 :
19440 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19441 : PyObject *__pyx_r = NULL;
19442 : __Pyx_RefNannyDeclarations
19443 : PyObject *__pyx_t_1 = NULL;
19444 : int __pyx_lineno = 0;
19445 : const char *__pyx_filename = NULL;
19446 : int __pyx_clineno = 0;
19447 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19448 :
19449 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
19450 : *
19451 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19452 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19453 : *
19454 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19455 : */
19456 : __Pyx_XDECREF(__pyx_r);
19457 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error)
19458 : __Pyx_GOTREF(__pyx_t_1);
19459 : __pyx_r = __pyx_t_1;
19460 : __pyx_t_1 = 0;
19461 : goto __pyx_L0;
19462 :
19463 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19464 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19465 : *
19466 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19467 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19468 : *
19469 : */
19470 :
19471 : /* function exit code */
19472 : __pyx_L1_error:;
19473 : __Pyx_XDECREF(__pyx_t_1);
19474 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19475 : __pyx_r = 0;
19476 : __pyx_L0:;
19477 : __Pyx_XGIVEREF(__pyx_r);
19478 : __Pyx_RefNannyFinishContext();
19479 : return __pyx_r;
19480 : }
19481 :
19482 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19483 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19484 : *
19485 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19486 : * if PyDataType_HASSUBARRAY(d):
19487 : * return <tuple>d.subarray.shape
19488 : */
19489 :
19490 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19491 : PyObject *__pyx_r = NULL;
19492 : __Pyx_RefNannyDeclarations
19493 : int __pyx_t_1;
19494 : PyObject *__pyx_t_2;
19495 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19496 :
19497 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19498 : *
19499 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19500 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19501 : * return <tuple>d.subarray.shape
19502 : * else:
19503 : */
19504 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19505 : if (__pyx_t_1) {
19506 :
19507 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
19508 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19509 : * if PyDataType_HASSUBARRAY(d):
19510 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
19511 : * else:
19512 : * return ()
19513 : */
19514 : __Pyx_XDECREF(__pyx_r);
19515 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
19516 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
19517 : __pyx_r = ((PyObject*)__pyx_t_2);
19518 : goto __pyx_L0;
19519 :
19520 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19521 : *
19522 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19523 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19524 : * return <tuple>d.subarray.shape
19525 : * else:
19526 : */
19527 : }
19528 :
19529 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
19530 : * return <tuple>d.subarray.shape
19531 : * else:
19532 : * return () # <<<<<<<<<<<<<<
19533 : *
19534 : *
19535 : */
19536 : /*else*/ {
19537 : __Pyx_XDECREF(__pyx_r);
19538 : __Pyx_INCREF(__pyx_empty_tuple);
19539 : __pyx_r = __pyx_empty_tuple;
19540 : goto __pyx_L0;
19541 : }
19542 :
19543 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19544 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19545 : *
19546 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19547 : * if PyDataType_HASSUBARRAY(d):
19548 : * return <tuple>d.subarray.shape
19549 : */
19550 :
19551 : /* function exit code */
19552 : __pyx_L0:;
19553 : __Pyx_XGIVEREF(__pyx_r);
19554 : __Pyx_RefNannyFinishContext();
19555 : return __pyx_r;
19556 : }
19557 :
19558 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19559 : * int _import_umath() except -1
19560 : *
19561 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19562 : * Py_INCREF(base) # important to do this before stealing the reference below!
19563 : * PyArray_SetBaseObject(arr, base)
19564 : */
19565 :
19566 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19567 : int __pyx_t_1;
19568 : int __pyx_lineno = 0;
19569 : const char *__pyx_filename = NULL;
19570 : int __pyx_clineno = 0;
19571 :
19572 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
19573 : *
19574 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19575 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
19576 : * PyArray_SetBaseObject(arr, base)
19577 : *
19578 : */
19579 : Py_INCREF(__pyx_v_base);
19580 :
19581 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
19582 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19583 : * Py_INCREF(base) # important to do this before stealing the reference below!
19584 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
19585 : *
19586 : * cdef inline object get_array_base(ndarray arr):
19587 : */
19588 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error)
19589 :
19590 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19591 : * int _import_umath() except -1
19592 : *
19593 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19594 : * Py_INCREF(base) # important to do this before stealing the reference below!
19595 : * PyArray_SetBaseObject(arr, base)
19596 : */
19597 :
19598 : /* function exit code */
19599 : goto __pyx_L0;
19600 : __pyx_L1_error:;
19601 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
19602 : __pyx_L0:;
19603 : }
19604 :
19605 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19606 : * PyArray_SetBaseObject(arr, base)
19607 : *
19608 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19609 : * base = PyArray_BASE(arr)
19610 : * if base is NULL:
19611 : */
19612 :
19613 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
19614 : PyObject *__pyx_v_base;
19615 : PyObject *__pyx_r = NULL;
19616 : __Pyx_RefNannyDeclarations
19617 : int __pyx_t_1;
19618 : __Pyx_RefNannySetupContext("get_array_base", 1);
19619 :
19620 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
19621 : *
19622 : * cdef inline object get_array_base(ndarray arr):
19623 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
19624 : * if base is NULL:
19625 : * return None
19626 : */
19627 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
19628 :
19629 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19630 : * cdef inline object get_array_base(ndarray arr):
19631 : * base = PyArray_BASE(arr)
19632 : * if base is NULL: # <<<<<<<<<<<<<<
19633 : * return None
19634 : * return <object>base
19635 : */
19636 : __pyx_t_1 = (__pyx_v_base == NULL);
19637 : if (__pyx_t_1) {
19638 :
19639 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
19640 : * base = PyArray_BASE(arr)
19641 : * if base is NULL:
19642 : * return None # <<<<<<<<<<<<<<
19643 : * return <object>base
19644 : *
19645 : */
19646 : __Pyx_XDECREF(__pyx_r);
19647 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19648 : goto __pyx_L0;
19649 :
19650 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19651 : * cdef inline object get_array_base(ndarray arr):
19652 : * base = PyArray_BASE(arr)
19653 : * if base is NULL: # <<<<<<<<<<<<<<
19654 : * return None
19655 : * return <object>base
19656 : */
19657 : }
19658 :
19659 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
19660 : * if base is NULL:
19661 : * return None
19662 : * return <object>base # <<<<<<<<<<<<<<
19663 : *
19664 : * # Versions of the import_* functions which are more suitable for
19665 : */
19666 : __Pyx_XDECREF(__pyx_r);
19667 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
19668 : __pyx_r = ((PyObject *)__pyx_v_base);
19669 : goto __pyx_L0;
19670 :
19671 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19672 : * PyArray_SetBaseObject(arr, base)
19673 : *
19674 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19675 : * base = PyArray_BASE(arr)
19676 : * if base is NULL:
19677 : */
19678 :
19679 : /* function exit code */
19680 : __pyx_L0:;
19681 : __Pyx_XGIVEREF(__pyx_r);
19682 : __Pyx_RefNannyFinishContext();
19683 : return __pyx_r;
19684 : }
19685 :
19686 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19687 : * # Versions of the import_* functions which are more suitable for
19688 : * # Cython code.
19689 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19690 : * try:
19691 : * __pyx_import_array()
19692 : */
19693 :
19694 3 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
19695 3 : int __pyx_r;
19696 : __Pyx_RefNannyDeclarations
19697 3 : PyObject *__pyx_t_1 = NULL;
19698 3 : PyObject *__pyx_t_2 = NULL;
19699 3 : PyObject *__pyx_t_3 = NULL;
19700 3 : int __pyx_t_4;
19701 3 : PyObject *__pyx_t_5 = NULL;
19702 3 : PyObject *__pyx_t_6 = NULL;
19703 3 : PyObject *__pyx_t_7 = NULL;
19704 3 : PyObject *__pyx_t_8 = NULL;
19705 3 : int __pyx_lineno = 0;
19706 3 : const char *__pyx_filename = NULL;
19707 3 : int __pyx_clineno = 0;
19708 3 : __Pyx_RefNannySetupContext("import_array", 1);
19709 :
19710 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19711 : * # Cython code.
19712 : * cdef inline int import_array() except -1:
19713 : * try: # <<<<<<<<<<<<<<
19714 : * __pyx_import_array()
19715 : * except Exception:
19716 : */
19717 : {
19718 3 : __Pyx_PyThreadState_declare
19719 3 : __Pyx_PyThreadState_assign
19720 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19721 3 : __Pyx_XGOTREF(__pyx_t_1);
19722 3 : __Pyx_XGOTREF(__pyx_t_2);
19723 3 : __Pyx_XGOTREF(__pyx_t_3);
19724 : /*try:*/ {
19725 :
19726 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
19727 : * cdef inline int import_array() except -1:
19728 : * try:
19729 : * __pyx_import_array() # <<<<<<<<<<<<<<
19730 : * except Exception:
19731 : * raise ImportError("numpy._core.multiarray failed to import")
19732 : */
19733 3 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error)
19734 :
19735 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19736 : * # Cython code.
19737 : * cdef inline int import_array() except -1:
19738 : * try: # <<<<<<<<<<<<<<
19739 : * __pyx_import_array()
19740 : * except Exception:
19741 : */
19742 : }
19743 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19744 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19745 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19746 3 : goto __pyx_L8_try_end;
19747 0 : __pyx_L3_error:;
19748 :
19749 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
19750 : * try:
19751 : * __pyx_import_array()
19752 : * except Exception: # <<<<<<<<<<<<<<
19753 : * raise ImportError("numpy._core.multiarray failed to import")
19754 : *
19755 : */
19756 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19757 0 : if (__pyx_t_4) {
19758 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19759 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error)
19760 0 : __Pyx_XGOTREF(__pyx_t_5);
19761 0 : __Pyx_XGOTREF(__pyx_t_6);
19762 0 : __Pyx_XGOTREF(__pyx_t_7);
19763 :
19764 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
19765 : * __pyx_import_array()
19766 : * except Exception:
19767 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
19768 : *
19769 : * cdef inline int import_umath() except -1:
19770 : */
19771 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error)
19772 0 : __Pyx_GOTREF(__pyx_t_8);
19773 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19774 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19775 0 : __PYX_ERR(2, 1025, __pyx_L5_except_error)
19776 : }
19777 0 : goto __pyx_L5_except_error;
19778 :
19779 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19780 : * # Cython code.
19781 : * cdef inline int import_array() except -1:
19782 : * try: # <<<<<<<<<<<<<<
19783 : * __pyx_import_array()
19784 : * except Exception:
19785 : */
19786 0 : __pyx_L5_except_error:;
19787 0 : __Pyx_XGIVEREF(__pyx_t_1);
19788 0 : __Pyx_XGIVEREF(__pyx_t_2);
19789 0 : __Pyx_XGIVEREF(__pyx_t_3);
19790 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19791 0 : goto __pyx_L1_error;
19792 3 : __pyx_L8_try_end:;
19793 : }
19794 :
19795 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19796 : * # Versions of the import_* functions which are more suitable for
19797 : * # Cython code.
19798 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19799 : * try:
19800 : * __pyx_import_array()
19801 : */
19802 :
19803 : /* function exit code */
19804 3 : __pyx_r = 0;
19805 3 : goto __pyx_L0;
19806 0 : __pyx_L1_error:;
19807 0 : __Pyx_XDECREF(__pyx_t_5);
19808 0 : __Pyx_XDECREF(__pyx_t_6);
19809 0 : __Pyx_XDECREF(__pyx_t_7);
19810 0 : __Pyx_XDECREF(__pyx_t_8);
19811 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19812 0 : __pyx_r = -1;
19813 3 : __pyx_L0:;
19814 3 : __Pyx_RefNannyFinishContext();
19815 3 : return __pyx_r;
19816 : }
19817 :
19818 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19819 : * raise ImportError("numpy._core.multiarray failed to import")
19820 : *
19821 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19822 : * try:
19823 : * _import_umath()
19824 : */
19825 :
19826 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
19827 : int __pyx_r;
19828 : __Pyx_RefNannyDeclarations
19829 : PyObject *__pyx_t_1 = NULL;
19830 : PyObject *__pyx_t_2 = NULL;
19831 : PyObject *__pyx_t_3 = NULL;
19832 : int __pyx_t_4;
19833 : PyObject *__pyx_t_5 = NULL;
19834 : PyObject *__pyx_t_6 = NULL;
19835 : PyObject *__pyx_t_7 = NULL;
19836 : PyObject *__pyx_t_8 = NULL;
19837 : int __pyx_lineno = 0;
19838 : const char *__pyx_filename = NULL;
19839 : int __pyx_clineno = 0;
19840 : __Pyx_RefNannySetupContext("import_umath", 1);
19841 :
19842 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19843 : *
19844 : * cdef inline int import_umath() except -1:
19845 : * try: # <<<<<<<<<<<<<<
19846 : * _import_umath()
19847 : * except Exception:
19848 : */
19849 : {
19850 : __Pyx_PyThreadState_declare
19851 : __Pyx_PyThreadState_assign
19852 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19853 : __Pyx_XGOTREF(__pyx_t_1);
19854 : __Pyx_XGOTREF(__pyx_t_2);
19855 : __Pyx_XGOTREF(__pyx_t_3);
19856 : /*try:*/ {
19857 :
19858 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
19859 : * cdef inline int import_umath() except -1:
19860 : * try:
19861 : * _import_umath() # <<<<<<<<<<<<<<
19862 : * except Exception:
19863 : * raise ImportError("numpy._core.umath failed to import")
19864 : */
19865 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error)
19866 :
19867 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19868 : *
19869 : * cdef inline int import_umath() except -1:
19870 : * try: # <<<<<<<<<<<<<<
19871 : * _import_umath()
19872 : * except Exception:
19873 : */
19874 : }
19875 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19876 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19877 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19878 : goto __pyx_L8_try_end;
19879 : __pyx_L3_error:;
19880 :
19881 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
19882 : * try:
19883 : * _import_umath()
19884 : * except Exception: # <<<<<<<<<<<<<<
19885 : * raise ImportError("numpy._core.umath failed to import")
19886 : *
19887 : */
19888 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19889 : if (__pyx_t_4) {
19890 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19891 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error)
19892 : __Pyx_XGOTREF(__pyx_t_5);
19893 : __Pyx_XGOTREF(__pyx_t_6);
19894 : __Pyx_XGOTREF(__pyx_t_7);
19895 :
19896 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
19897 : * _import_umath()
19898 : * except Exception:
19899 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
19900 : *
19901 : * cdef inline int import_ufunc() except -1:
19902 : */
19903 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error)
19904 : __Pyx_GOTREF(__pyx_t_8);
19905 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19906 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19907 : __PYX_ERR(2, 1031, __pyx_L5_except_error)
19908 : }
19909 : goto __pyx_L5_except_error;
19910 :
19911 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19912 : *
19913 : * cdef inline int import_umath() except -1:
19914 : * try: # <<<<<<<<<<<<<<
19915 : * _import_umath()
19916 : * except Exception:
19917 : */
19918 : __pyx_L5_except_error:;
19919 : __Pyx_XGIVEREF(__pyx_t_1);
19920 : __Pyx_XGIVEREF(__pyx_t_2);
19921 : __Pyx_XGIVEREF(__pyx_t_3);
19922 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19923 : goto __pyx_L1_error;
19924 : __pyx_L8_try_end:;
19925 : }
19926 :
19927 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19928 : * raise ImportError("numpy._core.multiarray failed to import")
19929 : *
19930 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19931 : * try:
19932 : * _import_umath()
19933 : */
19934 :
19935 : /* function exit code */
19936 : __pyx_r = 0;
19937 : goto __pyx_L0;
19938 : __pyx_L1_error:;
19939 : __Pyx_XDECREF(__pyx_t_5);
19940 : __Pyx_XDECREF(__pyx_t_6);
19941 : __Pyx_XDECREF(__pyx_t_7);
19942 : __Pyx_XDECREF(__pyx_t_8);
19943 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19944 : __pyx_r = -1;
19945 : __pyx_L0:;
19946 : __Pyx_RefNannyFinishContext();
19947 : return __pyx_r;
19948 : }
19949 :
19950 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
19951 : * raise ImportError("numpy._core.umath failed to import")
19952 : *
19953 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
19954 : * try:
19955 : * _import_umath()
19956 : */
19957 :
19958 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
19959 : int __pyx_r;
19960 : __Pyx_RefNannyDeclarations
19961 : PyObject *__pyx_t_1 = NULL;
19962 : PyObject *__pyx_t_2 = NULL;
19963 : PyObject *__pyx_t_3 = NULL;
19964 : int __pyx_t_4;
19965 : PyObject *__pyx_t_5 = NULL;
19966 : PyObject *__pyx_t_6 = NULL;
19967 : PyObject *__pyx_t_7 = NULL;
19968 : PyObject *__pyx_t_8 = NULL;
19969 : int __pyx_lineno = 0;
19970 : const char *__pyx_filename = NULL;
19971 : int __pyx_clineno = 0;
19972 : __Pyx_RefNannySetupContext("import_ufunc", 1);
19973 :
19974 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19975 : *
19976 : * cdef inline int import_ufunc() except -1:
19977 : * try: # <<<<<<<<<<<<<<
19978 : * _import_umath()
19979 : * except Exception:
19980 : */
19981 : {
19982 : __Pyx_PyThreadState_declare
19983 : __Pyx_PyThreadState_assign
19984 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19985 : __Pyx_XGOTREF(__pyx_t_1);
19986 : __Pyx_XGOTREF(__pyx_t_2);
19987 : __Pyx_XGOTREF(__pyx_t_3);
19988 : /*try:*/ {
19989 :
19990 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
19991 : * cdef inline int import_ufunc() except -1:
19992 : * try:
19993 : * _import_umath() # <<<<<<<<<<<<<<
19994 : * except Exception:
19995 : * raise ImportError("numpy._core.umath failed to import")
19996 : */
19997 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error)
19998 :
19999 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20000 : *
20001 : * cdef inline int import_ufunc() except -1:
20002 : * try: # <<<<<<<<<<<<<<
20003 : * _import_umath()
20004 : * except Exception:
20005 : */
20006 : }
20007 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20008 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20009 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20010 : goto __pyx_L8_try_end;
20011 : __pyx_L3_error:;
20012 :
20013 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
20014 : * try:
20015 : * _import_umath()
20016 : * except Exception: # <<<<<<<<<<<<<<
20017 : * raise ImportError("numpy._core.umath failed to import")
20018 : *
20019 : */
20020 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20021 : if (__pyx_t_4) {
20022 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20023 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error)
20024 : __Pyx_XGOTREF(__pyx_t_5);
20025 : __Pyx_XGOTREF(__pyx_t_6);
20026 : __Pyx_XGOTREF(__pyx_t_7);
20027 :
20028 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
20029 : * _import_umath()
20030 : * except Exception:
20031 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20032 : *
20033 : *
20034 : */
20035 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error)
20036 : __Pyx_GOTREF(__pyx_t_8);
20037 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20038 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20039 : __PYX_ERR(2, 1037, __pyx_L5_except_error)
20040 : }
20041 : goto __pyx_L5_except_error;
20042 :
20043 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20044 : *
20045 : * cdef inline int import_ufunc() except -1:
20046 : * try: # <<<<<<<<<<<<<<
20047 : * _import_umath()
20048 : * except Exception:
20049 : */
20050 : __pyx_L5_except_error:;
20051 : __Pyx_XGIVEREF(__pyx_t_1);
20052 : __Pyx_XGIVEREF(__pyx_t_2);
20053 : __Pyx_XGIVEREF(__pyx_t_3);
20054 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20055 : goto __pyx_L1_error;
20056 : __pyx_L8_try_end:;
20057 : }
20058 :
20059 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
20060 : * raise ImportError("numpy._core.umath failed to import")
20061 : *
20062 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20063 : * try:
20064 : * _import_umath()
20065 : */
20066 :
20067 : /* function exit code */
20068 : __pyx_r = 0;
20069 : goto __pyx_L0;
20070 : __pyx_L1_error:;
20071 : __Pyx_XDECREF(__pyx_t_5);
20072 : __Pyx_XDECREF(__pyx_t_6);
20073 : __Pyx_XDECREF(__pyx_t_7);
20074 : __Pyx_XDECREF(__pyx_t_8);
20075 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20076 : __pyx_r = -1;
20077 : __pyx_L0:;
20078 : __Pyx_RefNannyFinishContext();
20079 : return __pyx_r;
20080 : }
20081 :
20082 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20083 : *
20084 : *
20085 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20086 : * """
20087 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20088 : */
20089 :
20090 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20091 : int __pyx_r;
20092 :
20093 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
20094 : * bool
20095 : * """
20096 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
20097 : *
20098 : *
20099 : */
20100 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20101 : goto __pyx_L0;
20102 :
20103 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20104 : *
20105 : *
20106 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20107 : * """
20108 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20109 : */
20110 :
20111 : /* function exit code */
20112 : __pyx_L0:;
20113 : return __pyx_r;
20114 : }
20115 :
20116 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20117 : *
20118 : *
20119 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20120 : * """
20121 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20122 : */
20123 :
20124 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20125 : int __pyx_r;
20126 :
20127 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
20128 : * bool
20129 : * """
20130 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
20131 : *
20132 : *
20133 : */
20134 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20135 : goto __pyx_L0;
20136 :
20137 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20138 : *
20139 : *
20140 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20141 : * """
20142 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20143 : */
20144 :
20145 : /* function exit code */
20146 : __pyx_L0:;
20147 : return __pyx_r;
20148 : }
20149 :
20150 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20151 : *
20152 : *
20153 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20154 : * """
20155 : * returns the int64 value underlying scalar numpy datetime64 object
20156 : */
20157 :
20158 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20159 : npy_datetime __pyx_r;
20160 :
20161 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
20162 : * also needed. That can be found using `get_datetime64_unit`.
20163 : * """
20164 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
20165 : *
20166 : *
20167 : */
20168 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20169 : goto __pyx_L0;
20170 :
20171 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20172 : *
20173 : *
20174 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20175 : * """
20176 : * returns the int64 value underlying scalar numpy datetime64 object
20177 : */
20178 :
20179 : /* function exit code */
20180 : __pyx_L0:;
20181 : return __pyx_r;
20182 : }
20183 :
20184 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20185 : *
20186 : *
20187 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20188 : * """
20189 : * returns the int64 value underlying scalar numpy timedelta64 object
20190 : */
20191 :
20192 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20193 : npy_timedelta __pyx_r;
20194 :
20195 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
20196 : * returns the int64 value underlying scalar numpy timedelta64 object
20197 : * """
20198 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
20199 : *
20200 : *
20201 : */
20202 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20203 : goto __pyx_L0;
20204 :
20205 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20206 : *
20207 : *
20208 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20209 : * """
20210 : * returns the int64 value underlying scalar numpy timedelta64 object
20211 : */
20212 :
20213 : /* function exit code */
20214 : __pyx_L0:;
20215 : return __pyx_r;
20216 : }
20217 :
20218 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20219 : *
20220 : *
20221 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20222 : * """
20223 : * returns the unit part of the dtype for a numpy datetime64 object.
20224 : */
20225 :
20226 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20227 : NPY_DATETIMEUNIT __pyx_r;
20228 :
20229 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
20230 : * returns the unit part of the dtype for a numpy datetime64 object.
20231 : * """
20232 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
20233 : *
20234 : *
20235 : */
20236 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20237 : goto __pyx_L0;
20238 :
20239 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20240 : *
20241 : *
20242 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20243 : * """
20244 : * returns the unit part of the dtype for a numpy datetime64 object.
20245 : */
20246 :
20247 : /* function exit code */
20248 : __pyx_L0:;
20249 : return __pyx_r;
20250 : }
20251 :
20252 : /* "scipy/sparse/csgraph/_flow.pyx":28
20253 : * """
20254 : *
20255 : * def __init__(self, flow_value, flow): # <<<<<<<<<<<<<<
20256 : * self.flow_value = flow_value
20257 : * self.flow = flow
20258 : */
20259 :
20260 : /* Python wrapper */
20261 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_1__init__(PyObject *__pyx_self,
20262 : #if CYTHON_METH_FASTCALL
20263 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20264 : #else
20265 : PyObject *__pyx_args, PyObject *__pyx_kwds
20266 : #endif
20267 : ); /*proto*/
20268 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
20269 16 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_1__init__(PyObject *__pyx_self,
20270 : #if CYTHON_METH_FASTCALL
20271 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20272 : #else
20273 : PyObject *__pyx_args, PyObject *__pyx_kwds
20274 : #endif
20275 : ) {
20276 16 : PyObject *__pyx_v_self = 0;
20277 16 : PyObject *__pyx_v_flow_value = 0;
20278 16 : PyObject *__pyx_v_flow = 0;
20279 : #if !CYTHON_METH_FASTCALL
20280 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20281 : #endif
20282 16 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20283 16 : PyObject* values[3] = {0,0,0};
20284 16 : int __pyx_lineno = 0;
20285 16 : const char *__pyx_filename = NULL;
20286 16 : int __pyx_clineno = 0;
20287 16 : PyObject *__pyx_r = 0;
20288 : __Pyx_RefNannyDeclarations
20289 16 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
20290 : #if !CYTHON_METH_FASTCALL
20291 : #if CYTHON_ASSUME_SAFE_MACROS
20292 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20293 : #else
20294 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20295 : #endif
20296 : #endif
20297 16 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20298 : {
20299 16 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_flow_value,&__pyx_n_s_flow,0};
20300 16 : if (__pyx_kwds) {
20301 0 : Py_ssize_t kw_args;
20302 0 : switch (__pyx_nargs) {
20303 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
20304 0 : CYTHON_FALLTHROUGH;
20305 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20306 0 : CYTHON_FALLTHROUGH;
20307 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20308 0 : CYTHON_FALLTHROUGH;
20309 0 : case 0: break;
20310 0 : default: goto __pyx_L5_argtuple_error;
20311 : }
20312 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
20313 0 : switch (__pyx_nargs) {
20314 0 : case 0:
20315 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
20316 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
20317 0 : kw_args--;
20318 : }
20319 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
20320 0 : else goto __pyx_L5_argtuple_error;
20321 0 : CYTHON_FALLTHROUGH;
20322 : case 1:
20323 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flow_value)) != 0)) {
20324 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
20325 0 : kw_args--;
20326 : }
20327 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
20328 : else {
20329 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 28, __pyx_L3_error)
20330 : }
20331 0 : CYTHON_FALLTHROUGH;
20332 : case 2:
20333 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flow)) != 0)) {
20334 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
20335 0 : kw_args--;
20336 : }
20337 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
20338 : else {
20339 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 28, __pyx_L3_error)
20340 : }
20341 : }
20342 0 : if (unlikely(kw_args > 0)) {
20343 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
20344 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 28, __pyx_L3_error)
20345 : }
20346 16 : } else if (unlikely(__pyx_nargs != 3)) {
20347 0 : goto __pyx_L5_argtuple_error;
20348 : } else {
20349 16 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20350 16 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20351 16 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
20352 : }
20353 16 : __pyx_v_self = values[0];
20354 16 : __pyx_v_flow_value = values[1];
20355 16 : __pyx_v_flow = values[2];
20356 : }
20357 16 : goto __pyx_L6_skip;
20358 0 : __pyx_L5_argtuple_error:;
20359 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 28, __pyx_L3_error)
20360 16 : __pyx_L6_skip:;
20361 16 : goto __pyx_L4_argument_unpacking_done;
20362 0 : __pyx_L3_error:;
20363 : {
20364 0 : Py_ssize_t __pyx_temp;
20365 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20366 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20367 : }
20368 : }
20369 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow.MaximumFlowResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20370 0 : __Pyx_RefNannyFinishContext();
20371 0 : return NULL;
20372 16 : __pyx_L4_argument_unpacking_done:;
20373 16 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult___init__(__pyx_self, __pyx_v_self, __pyx_v_flow_value, __pyx_v_flow);
20374 :
20375 : /* function exit code */
20376 : {
20377 16 : Py_ssize_t __pyx_temp;
20378 16 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20379 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20380 : }
20381 : }
20382 : __Pyx_RefNannyFinishContext();
20383 : return __pyx_r;
20384 : }
20385 :
20386 16 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_flow_value, PyObject *__pyx_v_flow) {
20387 16 : PyObject *__pyx_r = NULL;
20388 : __Pyx_RefNannyDeclarations
20389 16 : int __pyx_lineno = 0;
20390 16 : const char *__pyx_filename = NULL;
20391 16 : int __pyx_clineno = 0;
20392 16 : __Pyx_RefNannySetupContext("__init__", 1);
20393 :
20394 : /* "scipy/sparse/csgraph/_flow.pyx":29
20395 : *
20396 : * def __init__(self, flow_value, flow):
20397 : * self.flow_value = flow_value # <<<<<<<<<<<<<<
20398 : * self.flow = flow
20399 : *
20400 : */
20401 16 : if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_flow_value, __pyx_v_flow_value) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
20402 :
20403 : /* "scipy/sparse/csgraph/_flow.pyx":30
20404 : * def __init__(self, flow_value, flow):
20405 : * self.flow_value = flow_value
20406 : * self.flow = flow # <<<<<<<<<<<<<<
20407 : *
20408 : * def __repr__(self):
20409 : */
20410 16 : if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_flow, __pyx_v_flow) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
20411 :
20412 : /* "scipy/sparse/csgraph/_flow.pyx":28
20413 : * """
20414 : *
20415 : * def __init__(self, flow_value, flow): # <<<<<<<<<<<<<<
20416 : * self.flow_value = flow_value
20417 : * self.flow = flow
20418 : */
20419 :
20420 : /* function exit code */
20421 16 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20422 16 : goto __pyx_L0;
20423 0 : __pyx_L1_error:;
20424 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow.MaximumFlowResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20425 0 : __pyx_r = NULL;
20426 16 : __pyx_L0:;
20427 16 : __Pyx_XGIVEREF(__pyx_r);
20428 16 : __Pyx_RefNannyFinishContext();
20429 16 : return __pyx_r;
20430 : }
20431 :
20432 : /* "scipy/sparse/csgraph/_flow.pyx":32
20433 : * self.flow = flow
20434 : *
20435 : * def __repr__(self): # <<<<<<<<<<<<<<
20436 : * return 'MaximumFlowResult with value of %d' % self.flow_value
20437 : *
20438 : */
20439 :
20440 : /* Python wrapper */
20441 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_3__repr__(PyObject *__pyx_self,
20442 : #if CYTHON_METH_FASTCALL
20443 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20444 : #else
20445 : PyObject *__pyx_args, PyObject *__pyx_kwds
20446 : #endif
20447 : ); /*proto*/
20448 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
20449 0 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_3__repr__(PyObject *__pyx_self,
20450 : #if CYTHON_METH_FASTCALL
20451 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20452 : #else
20453 : PyObject *__pyx_args, PyObject *__pyx_kwds
20454 : #endif
20455 : ) {
20456 0 : PyObject *__pyx_v_self = 0;
20457 : #if !CYTHON_METH_FASTCALL
20458 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20459 : #endif
20460 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20461 0 : PyObject* values[1] = {0};
20462 0 : int __pyx_lineno = 0;
20463 0 : const char *__pyx_filename = NULL;
20464 0 : int __pyx_clineno = 0;
20465 0 : PyObject *__pyx_r = 0;
20466 : __Pyx_RefNannyDeclarations
20467 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
20468 : #if !CYTHON_METH_FASTCALL
20469 : #if CYTHON_ASSUME_SAFE_MACROS
20470 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20471 : #else
20472 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20473 : #endif
20474 : #endif
20475 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20476 : {
20477 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
20478 0 : if (__pyx_kwds) {
20479 0 : Py_ssize_t kw_args;
20480 0 : switch (__pyx_nargs) {
20481 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20482 0 : CYTHON_FALLTHROUGH;
20483 0 : case 0: break;
20484 0 : default: goto __pyx_L5_argtuple_error;
20485 : }
20486 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
20487 0 : switch (__pyx_nargs) {
20488 : case 0:
20489 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
20490 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
20491 0 : kw_args--;
20492 : }
20493 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L3_error)
20494 0 : else goto __pyx_L5_argtuple_error;
20495 : }
20496 0 : if (unlikely(kw_args > 0)) {
20497 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
20498 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 32, __pyx_L3_error)
20499 : }
20500 0 : } else if (unlikely(__pyx_nargs != 1)) {
20501 0 : goto __pyx_L5_argtuple_error;
20502 : } else {
20503 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20504 : }
20505 0 : __pyx_v_self = values[0];
20506 : }
20507 0 : goto __pyx_L6_skip;
20508 0 : __pyx_L5_argtuple_error:;
20509 0 : __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error)
20510 0 : __pyx_L6_skip:;
20511 0 : goto __pyx_L4_argument_unpacking_done;
20512 0 : __pyx_L3_error:;
20513 : {
20514 0 : Py_ssize_t __pyx_temp;
20515 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20516 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20517 : }
20518 : }
20519 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow.MaximumFlowResult.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20520 0 : __Pyx_RefNannyFinishContext();
20521 0 : return NULL;
20522 0 : __pyx_L4_argument_unpacking_done:;
20523 0 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_2__repr__(__pyx_self, __pyx_v_self);
20524 :
20525 : /* function exit code */
20526 : {
20527 0 : Py_ssize_t __pyx_temp;
20528 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20529 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20530 : }
20531 : }
20532 : __Pyx_RefNannyFinishContext();
20533 : return __pyx_r;
20534 : }
20535 :
20536 0 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
20537 0 : PyObject *__pyx_r = NULL;
20538 : __Pyx_RefNannyDeclarations
20539 0 : PyObject *__pyx_t_1 = NULL;
20540 0 : PyObject *__pyx_t_2 = NULL;
20541 0 : int __pyx_lineno = 0;
20542 0 : const char *__pyx_filename = NULL;
20543 0 : int __pyx_clineno = 0;
20544 0 : __Pyx_RefNannySetupContext("__repr__", 1);
20545 :
20546 : /* "scipy/sparse/csgraph/_flow.pyx":33
20547 : *
20548 : * def __repr__(self):
20549 : * return 'MaximumFlowResult with value of %d' % self.flow_value # <<<<<<<<<<<<<<
20550 : *
20551 : *
20552 : */
20553 0 : __Pyx_XDECREF(__pyx_r);
20554 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_flow_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
20555 0 : __Pyx_GOTREF(__pyx_t_1);
20556 0 : __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_MaximumFlowResult_with_value_of, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
20557 0 : __Pyx_GOTREF(__pyx_t_2);
20558 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20559 0 : __pyx_r = __pyx_t_2;
20560 0 : __pyx_t_2 = 0;
20561 0 : goto __pyx_L0;
20562 :
20563 : /* "scipy/sparse/csgraph/_flow.pyx":32
20564 : * self.flow = flow
20565 : *
20566 : * def __repr__(self): # <<<<<<<<<<<<<<
20567 : * return 'MaximumFlowResult with value of %d' % self.flow_value
20568 : *
20569 : */
20570 :
20571 : /* function exit code */
20572 0 : __pyx_L1_error:;
20573 0 : __Pyx_XDECREF(__pyx_t_1);
20574 0 : __Pyx_XDECREF(__pyx_t_2);
20575 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow.MaximumFlowResult.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20576 0 : __pyx_r = NULL;
20577 0 : __pyx_L0:;
20578 0 : __Pyx_XGIVEREF(__pyx_r);
20579 0 : __Pyx_RefNannyFinishContext();
20580 0 : return __pyx_r;
20581 : }
20582 :
20583 : /* "scipy/sparse/csgraph/_flow.pyx":36
20584 : *
20585 : *
20586 : * def maximum_flow(csgraph, source, sink, *, method='dinic'): # <<<<<<<<<<<<<<
20587 : * r"""
20588 : * maximum_flow(csgraph, source, sink)
20589 : */
20590 :
20591 : /* Python wrapper */
20592 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_1maximum_flow(PyObject *__pyx_self,
20593 : #if CYTHON_METH_FASTCALL
20594 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20595 : #else
20596 : PyObject *__pyx_args, PyObject *__pyx_kwds
20597 : #endif
20598 : ); /*proto*/
20599 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_5_flow_maximum_flow, "\n maximum_flow(csgraph, source, sink)\n\n Maximize the flow between two vertices in a graph.\n\n .. versionadded:: 1.4.0\n\n Parameters\n ----------\n csgraph : csr_array\n The square matrix representing a directed graph whose (i, j)'th entry\n is an integer representing the capacity of the edge between\n vertices i and j.\n source : int\n The source vertex from which the flow flows.\n sink : int\n The sink vertex to which the flow flows.\n method: {'edmonds_karp', 'dinic'}, optional\n The method/algorithm to be used for computing the maximum flow.\n Following methods are supported,\n\n * 'edmonds_karp': Edmonds Karp algorithm in [1]_.\n * 'dinic': Dinic's algorithm in [4]_.\n\n Default is 'dinic'.\n\n .. versionadded:: 1.8.0\n\n Returns\n -------\n res : MaximumFlowResult\n A maximum flow represented by a ``MaximumFlowResult``\n which includes the value of the flow in ``flow_value``,\n and the flow graph in ``flow``.\n\n Raises\n ------\n TypeError:\n if the input graph is not in CSR format.\n\n ValueError:\n if the capacity values are not integers, or the source or sink are out\n of bounds.\n\n Notes\n -----\n This solves the maximum flow problem on a given directed weighted graph:\n A flow associates to every edge a value, also called a flow, less than the\n capacity of the edge, so that for every vertex (apart from the source and\n the sink vertices), the total incoming flow is equal to the total outgoing\n flow. The value of a flow is the sum of the flow of all edges leaving the\n source vertex, and the maximum flow problem consists of finding a flow\n whose value is maximal.\n\n By the max-flow min-cut theorem, the maximal value of the flow is also the\n total weight of the edges in a minimum cut.\n\n To solve the problem, we provide Edmonds--Karp [1]_"" and Dinic's algorithm\n [4]_. The implementation of both algorithms strive to exploit sparsity.\n The time complexity of the former :math:`O(|V|\\,|E|^2)` and its space\n complexity is :math:`O(|E|)`. The latter achieves its performance by\n building level graphs and finding blocking flows in them. Its time\n complexity is :math:`O(|V|^2\\,|E|)` and its space complexity is\n :math:`O(|E|)`.\n\n The maximum flow problem is usually defined with real valued capacities,\n but we require that all capacities are integral to ensure convergence. When\n dealing with rational capacities, or capacities belonging to\n :math:`x\\mathbb{Q}` for some fixed :math:`x \\in \\mathbb{R}`, it is possible\n to reduce the problem to the integral case by scaling all capacities\n accordingly.\n\n Solving a maximum-flow problem can be used for example for graph cuts\n optimization in computer vision [3]_.\n\n References\n ----------\n .. [1] Edmonds, J. and Karp, R. M.\n Theoretical improvements in algorithmic efficiency for network flow\n problems. 1972. Journal of the ACM. 19 (2): pp. 248-264\n .. [2] Cormen, T. H. and Leiserson, C. E. and Rivest, R. L. and Stein C.\n Introduction to Algorithms. Second Edition. 2001. MIT Press.\n .. [3] https://en.wikipedia.org/wiki/Graph_cuts_in_computer_vision\n .. [4] Dinic, Efim A.\n Algorithm for solution of a problem of maximum flow in networks with\n power estimation. In Soviet Math. Doklady, vol. 11, pp. 1277-1280.\n 1970.\n\n Examples\n --------\n Perhaps the simplest flow problem is that of a graph of only two vertices\n with an edge from source (0) to sink (1)::\n\n (0) --5--> (1)\n\n Here, the maximum flow is simply the capacity of the edge:\n\n >>> import numpy as np\n >>> from scipy.sparse import csr_array\n >>> from scipy.sparse.csgraph import maximum_flow\n >>> graph = csr_array([[0, 5], ""[0, 0]])\n >>> maximum_flow(graph, 0, 1).flow_value\n 5\n >>> maximum_flow(graph, 0, 1, method='edmonds_karp').flow_value\n 5\n\n If, on the other hand, there is a bottleneck between source and sink, that\n can reduce the maximum flow::\n\n (0) --5--> (1) --3--> (2)\n\n >>> graph = csr_array([[0, 5, 0], [0, 0, 3], [0, 0, 0]])\n >>> maximum_flow(graph, 0, 2).flow_value\n 3\n\n A less trivial example is given in [2]_, Chapter 26.1:\n\n >>> graph = csr_array([[0, 16, 13, 0, 0, 0],\n ... [0, 0, 10, 12, 0, 0],\n ... [0, 4, 0, 0, 14, 0],\n ... [0, 0, 9, 0, 0, 20],\n ... [0, 0, 0, 7, 0, 4],\n ... [0, 0, 0, 0, 0, 0]])\n >>> maximum_flow(graph, 0, 5).flow_value\n 23\n\n It is possible to reduce the problem of finding a maximum matching in a\n bipartite graph to a maximum flow problem: Let :math:`G = ((U, V), E)` be a\n bipartite graph. Then, add to the graph a source vertex with edges to every\n vertex in :math:`U` and a sink vertex with edges from every vertex in\n :math:`V`. Finally, give every edge in the resulting graph a capacity of 1.\n Then, a maximum flow in the new graph gives a maximum matching in the\n original graph consisting of the edges in :math:`E` whose flow is positive.\n\n Assume that the edges are represented by a\n :math:`\\lvert U \\rvert \\times \\lvert V \\rvert` matrix in CSR format whose\n :math:`(i, j)`'th entry is 1 if there is an edge from :math:`i \\in U` to\n :math:`j \\in V` and 0 otherwise; that is, the input is of the form required\n by :func:`maximum_bipartite_matching`. Then the CSR representation of the\n graph constructed above contains this matrix as a block. Here's an example:\n\n >>> graph = csr_array([[0, 1, 0, 1], [1, 0, 1, 0], [0, 1, 1, 0]])\n >>> print(graph.toarray())\n [[0 1 0 1]\n [1 0 1 0]\n [0 ""1 1 0]]\n >>> i, j = graph.shape\n >>> n = graph.nnz\n >>> indptr = np.concatenate([[0],\n ... graph.indptr + i,\n ... np.arange(n + i + 1, n + i + j + 1),\n ... [n + i + j]])\n >>> indices = np.concatenate([np.arange(1, i + 1),\n ... graph.indices + i + 1,\n ... np.repeat(i + j + 1, j)])\n >>> data = np.ones(n + i + j, dtype=int)\n >>>\n >>> graph_flow = csr_array((data, indices, indptr))\n >>> print(graph_flow.toarray())\n [[0 1 1 1 0 0 0 0 0]\n [0 0 0 0 0 1 0 1 0]\n [0 0 0 0 1 0 1 0 0]\n [0 0 0 0 0 1 1 0 0]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 1]\n [0 0 0 0 0 0 0 0 0]]\n\n At this point, we can find the maximum flow between the added sink and the\n added source and the desired matching can be obtained by restricting the\n flow function to the block corresponding to the original graph:\n\n >>> result = maximum_flow(graph_flow, 0, i+j+1, method='dinic')\n >>> matching = result.flow[1:i+1, i+1:i+j+1]\n >>> print(matching.toarray())\n [[0 1 0 0]\n [1 0 0 0]\n [0 0 1 0]]\n\n This tells us that the first, second, and third vertex in :math:`U` are\n matched with the second, first, and third vertex in :math:`V` respectively.\n\n While this solves the maximum bipartite matching problem in general, note\n that algorithms specialized to that problem, such as\n :func:`maximum_bipartite_matching`, will generally perform better.\n\n This approach can also be used to solve various common generalizations of\n the maximum bipartite matching problem. If, for instance, some vertices can\n be matched with more than one other vertex, this may be handled by\n modifying the capacities of the new graph appropriately.\n\n ");
20600 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_5_flow_1maximum_flow = {"maximum_flow", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_5_flow_1maximum_flow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_5_flow_maximum_flow};
20601 33 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_1maximum_flow(PyObject *__pyx_self,
20602 : #if CYTHON_METH_FASTCALL
20603 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20604 : #else
20605 : PyObject *__pyx_args, PyObject *__pyx_kwds
20606 : #endif
20607 : ) {
20608 33 : PyObject *__pyx_v_csgraph = 0;
20609 33 : PyObject *__pyx_v_source = 0;
20610 33 : PyObject *__pyx_v_sink = 0;
20611 33 : PyObject *__pyx_v_method = 0;
20612 : #if !CYTHON_METH_FASTCALL
20613 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20614 : #endif
20615 33 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20616 33 : PyObject* values[4] = {0,0,0,0};
20617 33 : int __pyx_lineno = 0;
20618 33 : const char *__pyx_filename = NULL;
20619 33 : int __pyx_clineno = 0;
20620 33 : PyObject *__pyx_r = 0;
20621 : __Pyx_RefNannyDeclarations
20622 33 : __Pyx_RefNannySetupContext("maximum_flow (wrapper)", 0);
20623 : #if !CYTHON_METH_FASTCALL
20624 : #if CYTHON_ASSUME_SAFE_MACROS
20625 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20626 : #else
20627 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20628 : #endif
20629 : #endif
20630 33 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20631 : {
20632 33 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_csgraph,&__pyx_n_s_source,&__pyx_n_s_sink,&__pyx_n_s_method,0};
20633 33 : values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_dinic)));
20634 33 : if (__pyx_kwds) {
20635 28 : Py_ssize_t kw_args;
20636 28 : switch (__pyx_nargs) {
20637 28 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
20638 28 : CYTHON_FALLTHROUGH;
20639 28 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20640 28 : CYTHON_FALLTHROUGH;
20641 28 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20642 28 : CYTHON_FALLTHROUGH;
20643 28 : case 0: break;
20644 0 : default: goto __pyx_L5_argtuple_error;
20645 : }
20646 28 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
20647 28 : switch (__pyx_nargs) {
20648 0 : case 0:
20649 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csgraph)) != 0)) {
20650 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
20651 0 : kw_args--;
20652 : }
20653 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
20654 0 : else goto __pyx_L5_argtuple_error;
20655 0 : CYTHON_FALLTHROUGH;
20656 : case 1:
20657 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_source)) != 0)) {
20658 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
20659 0 : kw_args--;
20660 : }
20661 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
20662 : else {
20663 0 : __Pyx_RaiseArgtupleInvalid("maximum_flow", 1, 3, 3, 1); __PYX_ERR(0, 36, __pyx_L3_error)
20664 : }
20665 0 : CYTHON_FALLTHROUGH;
20666 : case 2:
20667 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sink)) != 0)) {
20668 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
20669 0 : kw_args--;
20670 : }
20671 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
20672 : else {
20673 0 : __Pyx_RaiseArgtupleInvalid("maximum_flow", 1, 3, 3, 2); __PYX_ERR(0, 36, __pyx_L3_error)
20674 : }
20675 : }
20676 28 : if (kw_args == 1) {
20677 28 : const Py_ssize_t index = 3;
20678 28 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
20679 28 : if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
20680 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
20681 : }
20682 28 : if (unlikely(kw_args > 0)) {
20683 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
20684 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "maximum_flow") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
20685 : }
20686 5 : } else if (unlikely(__pyx_nargs != 3)) {
20687 0 : goto __pyx_L5_argtuple_error;
20688 : } else {
20689 5 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20690 5 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20691 5 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
20692 : }
20693 33 : __pyx_v_csgraph = values[0];
20694 33 : __pyx_v_source = values[1];
20695 33 : __pyx_v_sink = values[2];
20696 33 : __pyx_v_method = values[3];
20697 : }
20698 33 : goto __pyx_L6_skip;
20699 0 : __pyx_L5_argtuple_error:;
20700 0 : __Pyx_RaiseArgtupleInvalid("maximum_flow", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error)
20701 33 : __pyx_L6_skip:;
20702 33 : goto __pyx_L4_argument_unpacking_done;
20703 0 : __pyx_L3_error:;
20704 : {
20705 0 : Py_ssize_t __pyx_temp;
20706 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20707 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20708 : }
20709 : }
20710 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow.maximum_flow", __pyx_clineno, __pyx_lineno, __pyx_filename);
20711 0 : __Pyx_RefNannyFinishContext();
20712 0 : return NULL;
20713 33 : __pyx_L4_argument_unpacking_done:;
20714 33 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_5_flow_maximum_flow(__pyx_self, __pyx_v_csgraph, __pyx_v_source, __pyx_v_sink, __pyx_v_method);
20715 :
20716 : /* function exit code */
20717 : {
20718 33 : Py_ssize_t __pyx_temp;
20719 33 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20720 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20721 : }
20722 : }
20723 : __Pyx_RefNannyFinishContext();
20724 : return __pyx_r;
20725 : }
20726 :
20727 33 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_maximum_flow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_csgraph, PyObject *__pyx_v_source, PyObject *__pyx_v_sink, PyObject *__pyx_v_method) {
20728 33 : PyObject *__pyx_v_csgraph_orig = NULL;
20729 33 : PyObject *__pyx_v_is_pydata_sparse = NULL;
20730 33 : PyObject *__pyx_v_pydata_sparse_cls = NULL;
20731 33 : PyObject *__pyx_v_csgraph_indices = NULL;
20732 33 : PyObject *__pyx_v_csgraph_indptr = NULL;
20733 33 : PyObject *__pyx_v_m = NULL;
20734 33 : PyObject *__pyx_v_rev_edge_ptr = NULL;
20735 33 : PyObject *__pyx_v_tails = NULL;
20736 33 : __Pyx_memviewslice __pyx_v_flow = { 0, 0, { 0 }, { 0 }, { 0 } };
20737 33 : PyObject *__pyx_v_flow_array = NULL;
20738 33 : PyObject *__pyx_v_flow_matrix = NULL;
20739 33 : PyObject *__pyx_v_source_flow = NULL;
20740 33 : PyObject *__pyx_r = NULL;
20741 : __Pyx_RefNannyDeclarations
20742 33 : PyObject *__pyx_t_1 = NULL;
20743 33 : PyObject *__pyx_t_2 = NULL;
20744 33 : PyObject *__pyx_t_3 = NULL;
20745 33 : unsigned int __pyx_t_4;
20746 33 : int __pyx_t_5;
20747 33 : PyObject *__pyx_t_6 = NULL;
20748 33 : int __pyx_t_7;
20749 33 : PyObject *__pyx_t_8 = NULL;
20750 33 : PyObject *(*__pyx_t_9)(PyObject *);
20751 33 : __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
20752 33 : __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
20753 33 : __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
20754 33 : __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
20755 33 : __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
20756 33 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_15;
20757 33 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_16;
20758 33 : __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
20759 33 : __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
20760 33 : __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
20761 33 : __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
20762 33 : __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
20763 33 : int __pyx_lineno = 0;
20764 33 : const char *__pyx_filename = NULL;
20765 33 : int __pyx_clineno = 0;
20766 33 : __Pyx_RefNannySetupContext("maximum_flow", 0);
20767 33 : __Pyx_INCREF(__pyx_v_csgraph);
20768 :
20769 : /* "scipy/sparse/csgraph/_flow.pyx":230
20770 : *
20771 : * """
20772 : * csgraph_orig = csgraph # <<<<<<<<<<<<<<
20773 : * is_pydata_sparse = is_pydata_spmatrix(csgraph)
20774 : * if is_pydata_sparse:
20775 : */
20776 33 : __Pyx_INCREF(__pyx_v_csgraph);
20777 33 : __pyx_v_csgraph_orig = __pyx_v_csgraph;
20778 :
20779 : /* "scipy/sparse/csgraph/_flow.pyx":231
20780 : * """
20781 : * csgraph_orig = csgraph
20782 : * is_pydata_sparse = is_pydata_spmatrix(csgraph) # <<<<<<<<<<<<<<
20783 : * if is_pydata_sparse:
20784 : * pydata_sparse_cls = csgraph.__class__
20785 : */
20786 33 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_pydata_spmatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
20787 33 : __Pyx_GOTREF(__pyx_t_2);
20788 33 : __pyx_t_3 = NULL;
20789 33 : __pyx_t_4 = 0;
20790 : #if CYTHON_UNPACK_METHODS
20791 33 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
20792 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
20793 0 : if (likely(__pyx_t_3)) {
20794 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20795 0 : __Pyx_INCREF(__pyx_t_3);
20796 0 : __Pyx_INCREF(function);
20797 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
20798 : __pyx_t_4 = 1;
20799 : }
20800 : }
20801 : #endif
20802 : {
20803 33 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_csgraph};
20804 33 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
20805 33 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20806 33 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
20807 33 : __Pyx_GOTREF(__pyx_t_1);
20808 33 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20809 : }
20810 33 : __pyx_v_is_pydata_sparse = __pyx_t_1;
20811 33 : __pyx_t_1 = 0;
20812 :
20813 : /* "scipy/sparse/csgraph/_flow.pyx":232
20814 : * csgraph_orig = csgraph
20815 : * is_pydata_sparse = is_pydata_spmatrix(csgraph)
20816 : * if is_pydata_sparse: # <<<<<<<<<<<<<<
20817 : * pydata_sparse_cls = csgraph.__class__
20818 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr")
20819 : */
20820 33 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_is_pydata_sparse); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 232, __pyx_L1_error)
20821 33 : if (__pyx_t_5) {
20822 :
20823 : /* "scipy/sparse/csgraph/_flow.pyx":233
20824 : * is_pydata_sparse = is_pydata_spmatrix(csgraph)
20825 : * if is_pydata_sparse:
20826 : * pydata_sparse_cls = csgraph.__class__ # <<<<<<<<<<<<<<
20827 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr")
20828 : * if not (issparse(csgraph) and csgraph.format == "csr"):
20829 : */
20830 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
20831 0 : __Pyx_GOTREF(__pyx_t_1);
20832 0 : __pyx_v_pydata_sparse_cls = __pyx_t_1;
20833 0 : __pyx_t_1 = 0;
20834 :
20835 : /* "scipy/sparse/csgraph/_flow.pyx":234
20836 : * if is_pydata_sparse:
20837 : * pydata_sparse_cls = csgraph.__class__
20838 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr") # <<<<<<<<<<<<<<
20839 : * if not (issparse(csgraph) and csgraph.format == "csr"):
20840 : * raise TypeError("graph must be in CSR format")
20841 : */
20842 0 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
20843 0 : __Pyx_GOTREF(__pyx_t_1);
20844 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
20845 0 : __Pyx_GOTREF(__pyx_t_2);
20846 0 : __Pyx_INCREF(__pyx_v_csgraph);
20847 0 : __Pyx_GIVEREF(__pyx_v_csgraph);
20848 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_csgraph)) __PYX_ERR(0, 234, __pyx_L1_error);
20849 0 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
20850 0 : __Pyx_GOTREF(__pyx_t_3);
20851 0 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_format, __pyx_n_u_csr) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
20852 0 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
20853 0 : __Pyx_GOTREF(__pyx_t_6);
20854 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20855 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20856 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20857 0 : __Pyx_DECREF_SET(__pyx_v_csgraph, __pyx_t_6);
20858 0 : __pyx_t_6 = 0;
20859 :
20860 : /* "scipy/sparse/csgraph/_flow.pyx":232
20861 : * csgraph_orig = csgraph
20862 : * is_pydata_sparse = is_pydata_spmatrix(csgraph)
20863 : * if is_pydata_sparse: # <<<<<<<<<<<<<<
20864 : * pydata_sparse_cls = csgraph.__class__
20865 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr")
20866 : */
20867 : }
20868 :
20869 : /* "scipy/sparse/csgraph/_flow.pyx":235
20870 : * pydata_sparse_cls = csgraph.__class__
20871 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr")
20872 : * if not (issparse(csgraph) and csgraph.format == "csr"): # <<<<<<<<<<<<<<
20873 : * raise TypeError("graph must be in CSR format")
20874 : * if not issubclass(csgraph.dtype.type, np.integer):
20875 : */
20876 33 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
20877 33 : __Pyx_GOTREF(__pyx_t_3);
20878 33 : __pyx_t_2 = NULL;
20879 33 : __pyx_t_4 = 0;
20880 : #if CYTHON_UNPACK_METHODS
20881 33 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
20882 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20883 0 : if (likely(__pyx_t_2)) {
20884 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20885 0 : __Pyx_INCREF(__pyx_t_2);
20886 0 : __Pyx_INCREF(function);
20887 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
20888 : __pyx_t_4 = 1;
20889 : }
20890 : }
20891 : #endif
20892 : {
20893 33 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_csgraph};
20894 33 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
20895 33 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20896 33 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
20897 33 : __Pyx_GOTREF(__pyx_t_6);
20898 33 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20899 : }
20900 33 : __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 235, __pyx_L1_error)
20901 33 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20902 33 : if (__pyx_t_7) {
20903 32 : } else {
20904 1 : __pyx_t_5 = __pyx_t_7;
20905 1 : goto __pyx_L5_bool_binop_done;
20906 : }
20907 32 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
20908 32 : __Pyx_GOTREF(__pyx_t_6);
20909 32 : __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_csr, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 235, __pyx_L1_error)
20910 32 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20911 32 : __pyx_t_5 = __pyx_t_7;
20912 33 : __pyx_L5_bool_binop_done:;
20913 33 : __pyx_t_7 = (!__pyx_t_5);
20914 33 : if (unlikely(__pyx_t_7)) {
20915 :
20916 : /* "scipy/sparse/csgraph/_flow.pyx":236
20917 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr")
20918 : * if not (issparse(csgraph) and csgraph.format == "csr"):
20919 : * raise TypeError("graph must be in CSR format") # <<<<<<<<<<<<<<
20920 : * if not issubclass(csgraph.dtype.type, np.integer):
20921 : * raise ValueError("graph capacities must be integers")
20922 : */
20923 2 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
20924 2 : __Pyx_GOTREF(__pyx_t_6);
20925 2 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
20926 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20927 2 : __PYX_ERR(0, 236, __pyx_L1_error)
20928 :
20929 : /* "scipy/sparse/csgraph/_flow.pyx":235
20930 : * pydata_sparse_cls = csgraph.__class__
20931 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr")
20932 : * if not (issparse(csgraph) and csgraph.format == "csr"): # <<<<<<<<<<<<<<
20933 : * raise TypeError("graph must be in CSR format")
20934 : * if not issubclass(csgraph.dtype.type, np.integer):
20935 : */
20936 : }
20937 :
20938 : /* "scipy/sparse/csgraph/_flow.pyx":237
20939 : * if not (issparse(csgraph) and csgraph.format == "csr"):
20940 : * raise TypeError("graph must be in CSR format")
20941 : * if not issubclass(csgraph.dtype.type, np.integer): # <<<<<<<<<<<<<<
20942 : * raise ValueError("graph capacities must be integers")
20943 : * elif csgraph.dtype != ITYPE:
20944 : */
20945 31 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
20946 31 : __Pyx_GOTREF(__pyx_t_6);
20947 31 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
20948 31 : __Pyx_GOTREF(__pyx_t_3);
20949 31 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20950 31 : __pyx_t_7 = PyObject_IsSubclass(__pyx_t_3, ((PyObject *)__pyx_ptype_5numpy_integer)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error)
20951 31 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20952 31 : __pyx_t_5 = (!__pyx_t_7);
20953 31 : if (unlikely(__pyx_t_5)) {
20954 :
20955 : /* "scipy/sparse/csgraph/_flow.pyx":238
20956 : * raise TypeError("graph must be in CSR format")
20957 : * if not issubclass(csgraph.dtype.type, np.integer):
20958 : * raise ValueError("graph capacities must be integers") # <<<<<<<<<<<<<<
20959 : * elif csgraph.dtype != ITYPE:
20960 : * csgraph = csgraph.astype(ITYPE)
20961 : */
20962 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
20963 1 : __Pyx_GOTREF(__pyx_t_3);
20964 1 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20965 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20966 1 : __PYX_ERR(0, 238, __pyx_L1_error)
20967 :
20968 : /* "scipy/sparse/csgraph/_flow.pyx":237
20969 : * if not (issparse(csgraph) and csgraph.format == "csr"):
20970 : * raise TypeError("graph must be in CSR format")
20971 : * if not issubclass(csgraph.dtype.type, np.integer): # <<<<<<<<<<<<<<
20972 : * raise ValueError("graph capacities must be integers")
20973 : * elif csgraph.dtype != ITYPE:
20974 : */
20975 : }
20976 :
20977 : /* "scipy/sparse/csgraph/_flow.pyx":239
20978 : * if not issubclass(csgraph.dtype.type, np.integer):
20979 : * raise ValueError("graph capacities must be integers")
20980 : * elif csgraph.dtype != ITYPE: # <<<<<<<<<<<<<<
20981 : * csgraph = csgraph.astype(ITYPE)
20982 : * if source == sink:
20983 : */
20984 30 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
20985 30 : __Pyx_GOTREF(__pyx_t_3);
20986 30 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error)
20987 30 : __Pyx_GOTREF(__pyx_t_6);
20988 30 : __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
20989 30 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20990 30 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20991 30 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 239, __pyx_L1_error)
20992 30 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20993 30 : if (__pyx_t_5) {
20994 :
20995 : /* "scipy/sparse/csgraph/_flow.pyx":240
20996 : * raise ValueError("graph capacities must be integers")
20997 : * elif csgraph.dtype != ITYPE:
20998 : * csgraph = csgraph.astype(ITYPE) # <<<<<<<<<<<<<<
20999 : * if source == sink:
21000 : * raise ValueError("source and sink vertices must differ")
21001 : */
21002 28 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error)
21003 28 : __Pyx_GOTREF(__pyx_t_6);
21004 28 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
21005 28 : __Pyx_GOTREF(__pyx_t_3);
21006 28 : __pyx_t_1 = NULL;
21007 28 : __pyx_t_4 = 0;
21008 : #if CYTHON_UNPACK_METHODS
21009 28 : if (likely(PyMethod_Check(__pyx_t_6))) {
21010 28 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
21011 28 : if (likely(__pyx_t_1)) {
21012 28 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
21013 28 : __Pyx_INCREF(__pyx_t_1);
21014 28 : __Pyx_INCREF(function);
21015 28 : __Pyx_DECREF_SET(__pyx_t_6, function);
21016 : __pyx_t_4 = 1;
21017 : }
21018 : }
21019 : #endif
21020 : {
21021 28 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
21022 28 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21023 28 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21024 28 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21025 28 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
21026 28 : __Pyx_GOTREF(__pyx_t_2);
21027 28 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21028 : }
21029 28 : __Pyx_DECREF_SET(__pyx_v_csgraph, __pyx_t_2);
21030 28 : __pyx_t_2 = 0;
21031 :
21032 : /* "scipy/sparse/csgraph/_flow.pyx":239
21033 : * if not issubclass(csgraph.dtype.type, np.integer):
21034 : * raise ValueError("graph capacities must be integers")
21035 : * elif csgraph.dtype != ITYPE: # <<<<<<<<<<<<<<
21036 : * csgraph = csgraph.astype(ITYPE)
21037 : * if source == sink:
21038 : */
21039 : }
21040 :
21041 : /* "scipy/sparse/csgraph/_flow.pyx":241
21042 : * elif csgraph.dtype != ITYPE:
21043 : * csgraph = csgraph.astype(ITYPE)
21044 : * if source == sink: # <<<<<<<<<<<<<<
21045 : * raise ValueError("source and sink vertices must differ")
21046 : * if csgraph.shape[0] != csgraph.shape[1]:
21047 : */
21048 30 : __pyx_t_2 = PyObject_RichCompare(__pyx_v_source, __pyx_v_sink, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
21049 30 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 241, __pyx_L1_error)
21050 30 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21051 30 : if (unlikely(__pyx_t_5)) {
21052 :
21053 : /* "scipy/sparse/csgraph/_flow.pyx":242
21054 : * csgraph = csgraph.astype(ITYPE)
21055 : * if source == sink:
21056 : * raise ValueError("source and sink vertices must differ") # <<<<<<<<<<<<<<
21057 : * if csgraph.shape[0] != csgraph.shape[1]:
21058 : * raise ValueError("graph must be specified as a square matrix.")
21059 : */
21060 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
21061 1 : __Pyx_GOTREF(__pyx_t_2);
21062 1 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21063 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21064 1 : __PYX_ERR(0, 242, __pyx_L1_error)
21065 :
21066 : /* "scipy/sparse/csgraph/_flow.pyx":241
21067 : * elif csgraph.dtype != ITYPE:
21068 : * csgraph = csgraph.astype(ITYPE)
21069 : * if source == sink: # <<<<<<<<<<<<<<
21070 : * raise ValueError("source and sink vertices must differ")
21071 : * if csgraph.shape[0] != csgraph.shape[1]:
21072 : */
21073 : }
21074 :
21075 : /* "scipy/sparse/csgraph/_flow.pyx":243
21076 : * if source == sink:
21077 : * raise ValueError("source and sink vertices must differ")
21078 : * if csgraph.shape[0] != csgraph.shape[1]: # <<<<<<<<<<<<<<
21079 : * raise ValueError("graph must be specified as a square matrix.")
21080 : * if source < 0 or source >= csgraph.shape[0]:
21081 : */
21082 29 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
21083 29 : __Pyx_GOTREF(__pyx_t_2);
21084 29 : __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
21085 29 : __Pyx_GOTREF(__pyx_t_6);
21086 29 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21087 29 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
21088 29 : __Pyx_GOTREF(__pyx_t_2);
21089 29 : __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
21090 29 : __Pyx_GOTREF(__pyx_t_3);
21091 29 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21092 29 : __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
21093 29 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21094 29 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21095 29 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 243, __pyx_L1_error)
21096 29 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21097 29 : if (unlikely(__pyx_t_5)) {
21098 :
21099 : /* "scipy/sparse/csgraph/_flow.pyx":244
21100 : * raise ValueError("source and sink vertices must differ")
21101 : * if csgraph.shape[0] != csgraph.shape[1]:
21102 : * raise ValueError("graph must be specified as a square matrix.") # <<<<<<<<<<<<<<
21103 : * if source < 0 or source >= csgraph.shape[0]:
21104 : * raise ValueError('source value ({}) must be between '.format(source) +
21105 : */
21106 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
21107 1 : __Pyx_GOTREF(__pyx_t_2);
21108 1 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21109 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21110 1 : __PYX_ERR(0, 244, __pyx_L1_error)
21111 :
21112 : /* "scipy/sparse/csgraph/_flow.pyx":243
21113 : * if source == sink:
21114 : * raise ValueError("source and sink vertices must differ")
21115 : * if csgraph.shape[0] != csgraph.shape[1]: # <<<<<<<<<<<<<<
21116 : * raise ValueError("graph must be specified as a square matrix.")
21117 : * if source < 0 or source >= csgraph.shape[0]:
21118 : */
21119 : }
21120 :
21121 : /* "scipy/sparse/csgraph/_flow.pyx":245
21122 : * if csgraph.shape[0] != csgraph.shape[1]:
21123 : * raise ValueError("graph must be specified as a square matrix.")
21124 : * if source < 0 or source >= csgraph.shape[0]: # <<<<<<<<<<<<<<
21125 : * raise ValueError('source value ({}) must be between '.format(source) +
21126 : * '0 and {}'.format(csgraph.shape[0] - 1))
21127 : */
21128 28 : __pyx_t_2 = PyObject_RichCompare(__pyx_v_source, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
21129 28 : __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 245, __pyx_L1_error)
21130 28 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21131 28 : if (!__pyx_t_7) {
21132 26 : } else {
21133 2 : __pyx_t_5 = __pyx_t_7;
21134 2 : goto __pyx_L11_bool_binop_done;
21135 : }
21136 26 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
21137 26 : __Pyx_GOTREF(__pyx_t_2);
21138 26 : __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
21139 26 : __Pyx_GOTREF(__pyx_t_3);
21140 26 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21141 26 : __pyx_t_2 = PyObject_RichCompare(__pyx_v_source, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
21142 26 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21143 26 : __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 245, __pyx_L1_error)
21144 26 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21145 26 : __pyx_t_5 = __pyx_t_7;
21146 28 : __pyx_L11_bool_binop_done:;
21147 28 : if (unlikely(__pyx_t_5)) {
21148 :
21149 : /* "scipy/sparse/csgraph/_flow.pyx":246
21150 : * raise ValueError("graph must be specified as a square matrix.")
21151 : * if source < 0 or source >= csgraph.shape[0]:
21152 : * raise ValueError('source value ({}) must be between '.format(source) + # <<<<<<<<<<<<<<
21153 : * '0 and {}'.format(csgraph.shape[0] - 1))
21154 : * if sink < 0 or sink >= csgraph.shape[0]:
21155 : */
21156 6 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_source_value_must_be_between, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
21157 6 : __Pyx_GOTREF(__pyx_t_3);
21158 6 : __pyx_t_6 = NULL;
21159 6 : __pyx_t_4 = 0;
21160 : #if CYTHON_UNPACK_METHODS
21161 6 : if (likely(PyMethod_Check(__pyx_t_3))) {
21162 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
21163 0 : if (likely(__pyx_t_6)) {
21164 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21165 0 : __Pyx_INCREF(__pyx_t_6);
21166 0 : __Pyx_INCREF(function);
21167 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
21168 : __pyx_t_4 = 1;
21169 : }
21170 : }
21171 : #endif
21172 : {
21173 6 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_source};
21174 6 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21175 6 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21176 6 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
21177 6 : __Pyx_GOTREF(__pyx_t_2);
21178 6 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21179 : }
21180 :
21181 : /* "scipy/sparse/csgraph/_flow.pyx":247
21182 : * if source < 0 or source >= csgraph.shape[0]:
21183 : * raise ValueError('source value ({}) must be between '.format(source) +
21184 : * '0 and {}'.format(csgraph.shape[0] - 1)) # <<<<<<<<<<<<<<
21185 : * if sink < 0 or sink >= csgraph.shape[0]:
21186 : * raise ValueError('sink value ({}) must be between '.format(sink) +
21187 : */
21188 6 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_and, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
21189 6 : __Pyx_GOTREF(__pyx_t_6);
21190 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
21191 6 : __Pyx_GOTREF(__pyx_t_1);
21192 6 : __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error)
21193 6 : __Pyx_GOTREF(__pyx_t_8);
21194 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21195 6 : __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
21196 6 : __Pyx_GOTREF(__pyx_t_1);
21197 6 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21198 6 : __pyx_t_8 = NULL;
21199 6 : __pyx_t_4 = 0;
21200 : #if CYTHON_UNPACK_METHODS
21201 6 : if (likely(PyMethod_Check(__pyx_t_6))) {
21202 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
21203 0 : if (likely(__pyx_t_8)) {
21204 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
21205 0 : __Pyx_INCREF(__pyx_t_8);
21206 0 : __Pyx_INCREF(function);
21207 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
21208 : __pyx_t_4 = 1;
21209 : }
21210 : }
21211 : #endif
21212 : {
21213 6 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
21214 6 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21215 6 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21216 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21217 6 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
21218 6 : __Pyx_GOTREF(__pyx_t_3);
21219 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21220 : }
21221 :
21222 : /* "scipy/sparse/csgraph/_flow.pyx":246
21223 : * raise ValueError("graph must be specified as a square matrix.")
21224 : * if source < 0 or source >= csgraph.shape[0]:
21225 : * raise ValueError('source value ({}) must be between '.format(source) + # <<<<<<<<<<<<<<
21226 : * '0 and {}'.format(csgraph.shape[0] - 1))
21227 : * if sink < 0 or sink >= csgraph.shape[0]:
21228 : */
21229 6 : __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
21230 6 : __Pyx_GOTREF(__pyx_t_6);
21231 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21232 6 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21233 6 : __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
21234 6 : __Pyx_GOTREF(__pyx_t_3);
21235 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21236 6 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21237 6 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21238 6 : __PYX_ERR(0, 246, __pyx_L1_error)
21239 :
21240 : /* "scipy/sparse/csgraph/_flow.pyx":245
21241 : * if csgraph.shape[0] != csgraph.shape[1]:
21242 : * raise ValueError("graph must be specified as a square matrix.")
21243 : * if source < 0 or source >= csgraph.shape[0]: # <<<<<<<<<<<<<<
21244 : * raise ValueError('source value ({}) must be between '.format(source) +
21245 : * '0 and {}'.format(csgraph.shape[0] - 1))
21246 : */
21247 : }
21248 :
21249 : /* "scipy/sparse/csgraph/_flow.pyx":248
21250 : * raise ValueError('source value ({}) must be between '.format(source) +
21251 : * '0 and {}'.format(csgraph.shape[0] - 1))
21252 : * if sink < 0 or sink >= csgraph.shape[0]: # <<<<<<<<<<<<<<
21253 : * raise ValueError('sink value ({}) must be between '.format(sink) +
21254 : * '0 and {}'.format(csgraph.shape[0] - 1))
21255 : */
21256 22 : __pyx_t_3 = PyObject_RichCompare(__pyx_v_sink, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
21257 22 : __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 248, __pyx_L1_error)
21258 22 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21259 22 : if (!__pyx_t_7) {
21260 20 : } else {
21261 2 : __pyx_t_5 = __pyx_t_7;
21262 2 : goto __pyx_L14_bool_binop_done;
21263 : }
21264 20 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
21265 20 : __Pyx_GOTREF(__pyx_t_3);
21266 20 : __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
21267 20 : __Pyx_GOTREF(__pyx_t_6);
21268 20 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21269 20 : __pyx_t_3 = PyObject_RichCompare(__pyx_v_sink, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
21270 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21271 20 : __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 248, __pyx_L1_error)
21272 20 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21273 : __pyx_t_5 = __pyx_t_7;
21274 22 : __pyx_L14_bool_binop_done:;
21275 22 : if (unlikely(__pyx_t_5)) {
21276 :
21277 : /* "scipy/sparse/csgraph/_flow.pyx":249
21278 : * '0 and {}'.format(csgraph.shape[0] - 1))
21279 : * if sink < 0 or sink >= csgraph.shape[0]:
21280 : * raise ValueError('sink value ({}) must be between '.format(sink) + # <<<<<<<<<<<<<<
21281 : * '0 and {}'.format(csgraph.shape[0] - 1))
21282 : *
21283 : */
21284 6 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_sink_value_must_be_between, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
21285 6 : __Pyx_GOTREF(__pyx_t_6);
21286 6 : __pyx_t_2 = NULL;
21287 6 : __pyx_t_4 = 0;
21288 : #if CYTHON_UNPACK_METHODS
21289 6 : if (likely(PyMethod_Check(__pyx_t_6))) {
21290 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
21291 0 : if (likely(__pyx_t_2)) {
21292 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
21293 0 : __Pyx_INCREF(__pyx_t_2);
21294 0 : __Pyx_INCREF(function);
21295 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
21296 : __pyx_t_4 = 1;
21297 : }
21298 : }
21299 : #endif
21300 : {
21301 6 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_sink};
21302 6 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21303 6 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21304 6 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
21305 6 : __Pyx_GOTREF(__pyx_t_3);
21306 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21307 : }
21308 :
21309 : /* "scipy/sparse/csgraph/_flow.pyx":250
21310 : * if sink < 0 or sink >= csgraph.shape[0]:
21311 : * raise ValueError('sink value ({}) must be between '.format(sink) +
21312 : * '0 and {}'.format(csgraph.shape[0] - 1)) # <<<<<<<<<<<<<<
21313 : *
21314 : * # Sorted indices are needed by both the _add_reverse_edges() and
21315 : */
21316 6 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_0_and, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
21317 6 : __Pyx_GOTREF(__pyx_t_2);
21318 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
21319 6 : __Pyx_GOTREF(__pyx_t_1);
21320 6 : __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 250, __pyx_L1_error)
21321 6 : __Pyx_GOTREF(__pyx_t_8);
21322 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21323 6 : __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
21324 6 : __Pyx_GOTREF(__pyx_t_1);
21325 6 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21326 6 : __pyx_t_8 = NULL;
21327 6 : __pyx_t_4 = 0;
21328 : #if CYTHON_UNPACK_METHODS
21329 6 : if (likely(PyMethod_Check(__pyx_t_2))) {
21330 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
21331 0 : if (likely(__pyx_t_8)) {
21332 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21333 0 : __Pyx_INCREF(__pyx_t_8);
21334 0 : __Pyx_INCREF(function);
21335 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21336 : __pyx_t_4 = 1;
21337 : }
21338 : }
21339 : #endif
21340 : {
21341 6 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
21342 6 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21343 6 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21344 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21345 6 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
21346 6 : __Pyx_GOTREF(__pyx_t_6);
21347 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21348 : }
21349 :
21350 : /* "scipy/sparse/csgraph/_flow.pyx":249
21351 : * '0 and {}'.format(csgraph.shape[0] - 1))
21352 : * if sink < 0 or sink >= csgraph.shape[0]:
21353 : * raise ValueError('sink value ({}) must be between '.format(sink) + # <<<<<<<<<<<<<<
21354 : * '0 and {}'.format(csgraph.shape[0] - 1))
21355 : *
21356 : */
21357 6 : __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
21358 6 : __Pyx_GOTREF(__pyx_t_2);
21359 6 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21360 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21361 6 : __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
21362 6 : __Pyx_GOTREF(__pyx_t_6);
21363 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21364 6 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
21365 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21366 6 : __PYX_ERR(0, 249, __pyx_L1_error)
21367 :
21368 : /* "scipy/sparse/csgraph/_flow.pyx":248
21369 : * raise ValueError('source value ({}) must be between '.format(source) +
21370 : * '0 and {}'.format(csgraph.shape[0] - 1))
21371 : * if sink < 0 or sink >= csgraph.shape[0]: # <<<<<<<<<<<<<<
21372 : * raise ValueError('sink value ({}) must be between '.format(sink) +
21373 : * '0 and {}'.format(csgraph.shape[0] - 1))
21374 : */
21375 : }
21376 :
21377 : /* "scipy/sparse/csgraph/_flow.pyx":254
21378 : * # Sorted indices are needed by both the _add_reverse_edges() and
21379 : * # the _make_edge_pointers() function.
21380 : * if not csgraph.has_sorted_indices: # <<<<<<<<<<<<<<
21381 : * csgraph = csgraph.sorted_indices()
21382 : *
21383 : */
21384 16 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error)
21385 16 : __Pyx_GOTREF(__pyx_t_6);
21386 16 : __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 254, __pyx_L1_error)
21387 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21388 16 : __pyx_t_7 = (!__pyx_t_5);
21389 16 : if (__pyx_t_7) {
21390 :
21391 : /* "scipy/sparse/csgraph/_flow.pyx":255
21392 : * # the _make_edge_pointers() function.
21393 : * if not csgraph.has_sorted_indices:
21394 : * csgraph = csgraph.sorted_indices() # <<<<<<<<<<<<<<
21395 : *
21396 : * csgraph_indices, csgraph_indptr = _safe_downcast_indices(csgraph)
21397 : */
21398 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_sorted_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
21399 0 : __Pyx_GOTREF(__pyx_t_2);
21400 0 : __pyx_t_3 = NULL;
21401 0 : __pyx_t_4 = 0;
21402 : #if CYTHON_UNPACK_METHODS
21403 0 : if (likely(PyMethod_Check(__pyx_t_2))) {
21404 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21405 0 : if (likely(__pyx_t_3)) {
21406 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21407 0 : __Pyx_INCREF(__pyx_t_3);
21408 0 : __Pyx_INCREF(function);
21409 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21410 : __pyx_t_4 = 1;
21411 : }
21412 : }
21413 : #endif
21414 : {
21415 0 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
21416 0 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
21417 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21418 0 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error)
21419 0 : __Pyx_GOTREF(__pyx_t_6);
21420 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21421 : }
21422 0 : __Pyx_DECREF_SET(__pyx_v_csgraph, __pyx_t_6);
21423 0 : __pyx_t_6 = 0;
21424 :
21425 : /* "scipy/sparse/csgraph/_flow.pyx":254
21426 : * # Sorted indices are needed by both the _add_reverse_edges() and
21427 : * # the _make_edge_pointers() function.
21428 : * if not csgraph.has_sorted_indices: # <<<<<<<<<<<<<<
21429 : * csgraph = csgraph.sorted_indices()
21430 : *
21431 : */
21432 : }
21433 :
21434 : /* "scipy/sparse/csgraph/_flow.pyx":257
21435 : * csgraph = csgraph.sorted_indices()
21436 : *
21437 : * csgraph_indices, csgraph_indptr = _safe_downcast_indices(csgraph) # <<<<<<<<<<<<<<
21438 : * if csgraph_indices is not csgraph.indices:
21439 : * # create a new object without copying data
21440 : */
21441 16 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_downcast_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
21442 16 : __Pyx_GOTREF(__pyx_t_2);
21443 16 : __pyx_t_3 = NULL;
21444 16 : __pyx_t_4 = 0;
21445 : #if CYTHON_UNPACK_METHODS
21446 16 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
21447 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21448 0 : if (likely(__pyx_t_3)) {
21449 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21450 0 : __Pyx_INCREF(__pyx_t_3);
21451 0 : __Pyx_INCREF(function);
21452 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21453 : __pyx_t_4 = 1;
21454 : }
21455 : }
21456 : #endif
21457 : {
21458 16 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_csgraph};
21459 16 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21460 16 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21461 16 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
21462 16 : __Pyx_GOTREF(__pyx_t_6);
21463 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21464 : }
21465 16 : if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
21466 16 : PyObject* sequence = __pyx_t_6;
21467 16 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
21468 16 : if (unlikely(size != 2)) {
21469 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21470 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21471 0 : __PYX_ERR(0, 257, __pyx_L1_error)
21472 : }
21473 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21474 16 : if (likely(PyTuple_CheckExact(sequence))) {
21475 16 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
21476 16 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
21477 : } else {
21478 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
21479 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
21480 : }
21481 16 : __Pyx_INCREF(__pyx_t_2);
21482 16 : __Pyx_INCREF(__pyx_t_3);
21483 : #else
21484 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
21485 : __Pyx_GOTREF(__pyx_t_2);
21486 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
21487 : __Pyx_GOTREF(__pyx_t_3);
21488 : #endif
21489 32 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21490 : } else {
21491 0 : Py_ssize_t index = -1;
21492 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
21493 0 : __Pyx_GOTREF(__pyx_t_1);
21494 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21495 0 : __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
21496 0 : index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed;
21497 0 : __Pyx_GOTREF(__pyx_t_2);
21498 0 : index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed;
21499 0 : __Pyx_GOTREF(__pyx_t_3);
21500 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_1), 2) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
21501 0 : __pyx_t_9 = NULL;
21502 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21503 0 : goto __pyx_L18_unpacking_done;
21504 0 : __pyx_L17_unpacking_failed:;
21505 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21506 0 : __pyx_t_9 = NULL;
21507 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
21508 0 : __PYX_ERR(0, 257, __pyx_L1_error)
21509 0 : __pyx_L18_unpacking_done:;
21510 : }
21511 16 : __pyx_v_csgraph_indices = __pyx_t_2;
21512 16 : __pyx_t_2 = 0;
21513 16 : __pyx_v_csgraph_indptr = __pyx_t_3;
21514 16 : __pyx_t_3 = 0;
21515 :
21516 : /* "scipy/sparse/csgraph/_flow.pyx":258
21517 : *
21518 : * csgraph_indices, csgraph_indptr = _safe_downcast_indices(csgraph)
21519 : * if csgraph_indices is not csgraph.indices: # <<<<<<<<<<<<<<
21520 : * # create a new object without copying data
21521 : * csgraph = csr_array((csgraph.data, csgraph_indices, csgraph_indptr),
21522 : */
21523 16 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
21524 16 : __Pyx_GOTREF(__pyx_t_6);
21525 16 : __pyx_t_7 = (__pyx_v_csgraph_indices != __pyx_t_6);
21526 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21527 16 : if (__pyx_t_7) {
21528 :
21529 : /* "scipy/sparse/csgraph/_flow.pyx":260
21530 : * if csgraph_indices is not csgraph.indices:
21531 : * # create a new object without copying data
21532 : * csgraph = csr_array((csgraph.data, csgraph_indices, csgraph_indptr), # <<<<<<<<<<<<<<
21533 : * shape=csgraph.shape, dtype=csgraph.dtype)
21534 : *
21535 : */
21536 2 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error)
21537 2 : __Pyx_GOTREF(__pyx_t_6);
21538 2 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
21539 2 : __Pyx_GOTREF(__pyx_t_3);
21540 2 : __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
21541 2 : __Pyx_GOTREF(__pyx_t_2);
21542 2 : __Pyx_GIVEREF(__pyx_t_3);
21543 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error);
21544 2 : __Pyx_INCREF(__pyx_v_csgraph_indices);
21545 2 : __Pyx_GIVEREF(__pyx_v_csgraph_indices);
21546 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_csgraph_indices)) __PYX_ERR(0, 260, __pyx_L1_error);
21547 2 : __Pyx_INCREF(__pyx_v_csgraph_indptr);
21548 2 : __Pyx_GIVEREF(__pyx_v_csgraph_indptr);
21549 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_csgraph_indptr)) __PYX_ERR(0, 260, __pyx_L1_error);
21550 2 : __pyx_t_3 = 0;
21551 2 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
21552 2 : __Pyx_GOTREF(__pyx_t_3);
21553 2 : __Pyx_GIVEREF(__pyx_t_2);
21554 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error);
21555 2 : __pyx_t_2 = 0;
21556 :
21557 : /* "scipy/sparse/csgraph/_flow.pyx":261
21558 : * # create a new object without copying data
21559 : * csgraph = csr_array((csgraph.data, csgraph_indices, csgraph_indptr),
21560 : * shape=csgraph.shape, dtype=csgraph.dtype) # <<<<<<<<<<<<<<
21561 : *
21562 : * # Our maximum flow solvers assume that edges always exist
21563 : */
21564 2 : __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
21565 2 : __Pyx_GOTREF(__pyx_t_2);
21566 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
21567 2 : __Pyx_GOTREF(__pyx_t_1);
21568 2 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
21569 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21570 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_csgraph, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
21571 2 : __Pyx_GOTREF(__pyx_t_1);
21572 2 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
21573 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21574 :
21575 : /* "scipy/sparse/csgraph/_flow.pyx":260
21576 : * if csgraph_indices is not csgraph.indices:
21577 : * # create a new object without copying data
21578 : * csgraph = csr_array((csgraph.data, csgraph_indices, csgraph_indptr), # <<<<<<<<<<<<<<
21579 : * shape=csgraph.shape, dtype=csgraph.dtype)
21580 : *
21581 : */
21582 2 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
21583 2 : __Pyx_GOTREF(__pyx_t_1);
21584 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21585 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21586 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21587 2 : __Pyx_DECREF_SET(__pyx_v_csgraph, __pyx_t_1);
21588 : __pyx_t_1 = 0;
21589 :
21590 : /* "scipy/sparse/csgraph/_flow.pyx":258
21591 : *
21592 : * csgraph_indices, csgraph_indptr = _safe_downcast_indices(csgraph)
21593 : * if csgraph_indices is not csgraph.indices: # <<<<<<<<<<<<<<
21594 : * # create a new object without copying data
21595 : * csgraph = csr_array((csgraph.data, csgraph_indices, csgraph_indptr),
21596 : */
21597 : }
21598 :
21599 : /* "scipy/sparse/csgraph/_flow.pyx":266
21600 : * # in both directions, so we start by adding the reversed edges whenever
21601 : * # they are missing.
21602 : * m = _add_reverse_edges(csgraph) # <<<<<<<<<<<<<<
21603 : * rev_edge_ptr = _make_edge_pointers(m)
21604 : * if method == 'edmonds_karp':
21605 : */
21606 16 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_add_reverse_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
21607 16 : __Pyx_GOTREF(__pyx_t_2);
21608 16 : __pyx_t_3 = NULL;
21609 16 : __pyx_t_4 = 0;
21610 : #if CYTHON_UNPACK_METHODS
21611 16 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
21612 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21613 0 : if (likely(__pyx_t_3)) {
21614 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21615 0 : __Pyx_INCREF(__pyx_t_3);
21616 0 : __Pyx_INCREF(function);
21617 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21618 : __pyx_t_4 = 1;
21619 : }
21620 : }
21621 : #endif
21622 : {
21623 16 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_csgraph};
21624 16 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21625 16 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21626 16 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
21627 16 : __Pyx_GOTREF(__pyx_t_1);
21628 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21629 : }
21630 16 : __pyx_v_m = __pyx_t_1;
21631 16 : __pyx_t_1 = 0;
21632 :
21633 : /* "scipy/sparse/csgraph/_flow.pyx":267
21634 : * # they are missing.
21635 : * m = _add_reverse_edges(csgraph)
21636 : * rev_edge_ptr = _make_edge_pointers(m) # <<<<<<<<<<<<<<
21637 : * if method == 'edmonds_karp':
21638 : * tails = _make_tails(m)
21639 : */
21640 16 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_make_edge_pointers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
21641 16 : __Pyx_GOTREF(__pyx_t_2);
21642 16 : __pyx_t_3 = NULL;
21643 16 : __pyx_t_4 = 0;
21644 : #if CYTHON_UNPACK_METHODS
21645 16 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
21646 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21647 0 : if (likely(__pyx_t_3)) {
21648 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21649 0 : __Pyx_INCREF(__pyx_t_3);
21650 0 : __Pyx_INCREF(function);
21651 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21652 : __pyx_t_4 = 1;
21653 : }
21654 : }
21655 : #endif
21656 : {
21657 16 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_m};
21658 16 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21659 16 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21660 16 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
21661 16 : __Pyx_GOTREF(__pyx_t_1);
21662 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21663 : }
21664 16 : __pyx_v_rev_edge_ptr = __pyx_t_1;
21665 16 : __pyx_t_1 = 0;
21666 :
21667 : /* "scipy/sparse/csgraph/_flow.pyx":268
21668 : * m = _add_reverse_edges(csgraph)
21669 : * rev_edge_ptr = _make_edge_pointers(m)
21670 : * if method == 'edmonds_karp': # <<<<<<<<<<<<<<
21671 : * tails = _make_tails(m)
21672 : * flow = _edmonds_karp(m.indptr, tails, m.indices,
21673 : */
21674 16 : __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_n_u_edmonds_karp, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 268, __pyx_L1_error)
21675 16 : if (__pyx_t_7) {
21676 :
21677 : /* "scipy/sparse/csgraph/_flow.pyx":269
21678 : * rev_edge_ptr = _make_edge_pointers(m)
21679 : * if method == 'edmonds_karp':
21680 : * tails = _make_tails(m) # <<<<<<<<<<<<<<
21681 : * flow = _edmonds_karp(m.indptr, tails, m.indices,
21682 : * m.data, rev_edge_ptr, source, sink)
21683 : */
21684 8 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_make_tails); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
21685 8 : __Pyx_GOTREF(__pyx_t_2);
21686 8 : __pyx_t_3 = NULL;
21687 8 : __pyx_t_4 = 0;
21688 : #if CYTHON_UNPACK_METHODS
21689 8 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
21690 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21691 0 : if (likely(__pyx_t_3)) {
21692 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21693 0 : __Pyx_INCREF(__pyx_t_3);
21694 0 : __Pyx_INCREF(function);
21695 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21696 : __pyx_t_4 = 1;
21697 : }
21698 : }
21699 : #endif
21700 : {
21701 8 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_m};
21702 8 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21703 8 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21704 8 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
21705 8 : __Pyx_GOTREF(__pyx_t_1);
21706 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21707 : }
21708 8 : __pyx_v_tails = __pyx_t_1;
21709 8 : __pyx_t_1 = 0;
21710 :
21711 : /* "scipy/sparse/csgraph/_flow.pyx":270
21712 : * if method == 'edmonds_karp':
21713 : * tails = _make_tails(m)
21714 : * flow = _edmonds_karp(m.indptr, tails, m.indices, # <<<<<<<<<<<<<<
21715 : * m.data, rev_edge_ptr, source, sink)
21716 : * elif method == 'dinic':
21717 : */
21718 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
21719 8 : __Pyx_GOTREF(__pyx_t_1);
21720 8 : __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 270, __pyx_L1_error)
21721 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21722 8 : __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_v_tails, 0); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 270, __pyx_L1_error)
21723 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
21724 8 : __Pyx_GOTREF(__pyx_t_1);
21725 8 : __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 270, __pyx_L1_error)
21726 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21727 :
21728 : /* "scipy/sparse/csgraph/_flow.pyx":271
21729 : * tails = _make_tails(m)
21730 : * flow = _edmonds_karp(m.indptr, tails, m.indices,
21731 : * m.data, rev_edge_ptr, source, sink) # <<<<<<<<<<<<<<
21732 : * elif method == 'dinic':
21733 : * flow = _dinic(m.indptr, m.indices, m.data, rev_edge_ptr,
21734 : */
21735 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
21736 8 : __Pyx_GOTREF(__pyx_t_1);
21737 8 : __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 271, __pyx_L1_error)
21738 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21739 8 : __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_v_rev_edge_ptr, 0); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 271, __pyx_L1_error)
21740 8 : __pyx_t_15 = __Pyx_PyInt_As_npy_int32(__pyx_v_source); if (unlikely((__pyx_t_15 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error)
21741 8 : __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_v_sink); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error)
21742 :
21743 : /* "scipy/sparse/csgraph/_flow.pyx":270
21744 : * if method == 'edmonds_karp':
21745 : * tails = _make_tails(m)
21746 : * flow = _edmonds_karp(m.indptr, tails, m.indices, # <<<<<<<<<<<<<<
21747 : * m.data, rev_edge_ptr, source, sink)
21748 : * elif method == 'dinic':
21749 : */
21750 8 : __pyx_t_17 = __pyx_f_5scipy_6sparse_7csgraph_5_flow__edmonds_karp(__pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 270, __pyx_L1_error)
21751 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
21752 8 : __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL;
21753 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
21754 8 : __pyx_t_11.memview = NULL; __pyx_t_11.data = NULL;
21755 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
21756 8 : __pyx_t_12.memview = NULL; __pyx_t_12.data = NULL;
21757 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_13, 1);
21758 8 : __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL;
21759 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
21760 8 : __pyx_t_14.memview = NULL; __pyx_t_14.data = NULL;
21761 8 : __pyx_v_flow = __pyx_t_17;
21762 8 : __pyx_t_17.memview = NULL;
21763 8 : __pyx_t_17.data = NULL;
21764 :
21765 : /* "scipy/sparse/csgraph/_flow.pyx":268
21766 : * m = _add_reverse_edges(csgraph)
21767 : * rev_edge_ptr = _make_edge_pointers(m)
21768 : * if method == 'edmonds_karp': # <<<<<<<<<<<<<<
21769 : * tails = _make_tails(m)
21770 : * flow = _edmonds_karp(m.indptr, tails, m.indices,
21771 : */
21772 8 : goto __pyx_L20;
21773 : }
21774 :
21775 : /* "scipy/sparse/csgraph/_flow.pyx":272
21776 : * flow = _edmonds_karp(m.indptr, tails, m.indices,
21777 : * m.data, rev_edge_ptr, source, sink)
21778 : * elif method == 'dinic': # <<<<<<<<<<<<<<
21779 : * flow = _dinic(m.indptr, m.indices, m.data, rev_edge_ptr,
21780 : * source, sink)
21781 : */
21782 8 : __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_method, __pyx_n_u_dinic, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 272, __pyx_L1_error)
21783 8 : if (likely(__pyx_t_7)) {
21784 :
21785 : /* "scipy/sparse/csgraph/_flow.pyx":273
21786 : * m.data, rev_edge_ptr, source, sink)
21787 : * elif method == 'dinic':
21788 : * flow = _dinic(m.indptr, m.indices, m.data, rev_edge_ptr, # <<<<<<<<<<<<<<
21789 : * source, sink)
21790 : * else:
21791 : */
21792 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
21793 8 : __Pyx_GOTREF(__pyx_t_1);
21794 8 : __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 273, __pyx_L1_error)
21795 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21796 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
21797 8 : __Pyx_GOTREF(__pyx_t_1);
21798 8 : __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_t_1, 0); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 273, __pyx_L1_error)
21799 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21800 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
21801 8 : __Pyx_GOTREF(__pyx_t_1);
21802 8 : __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 273, __pyx_L1_error)
21803 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21804 8 : __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(__pyx_v_rev_edge_ptr, 0); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 273, __pyx_L1_error)
21805 :
21806 : /* "scipy/sparse/csgraph/_flow.pyx":274
21807 : * elif method == 'dinic':
21808 : * flow = _dinic(m.indptr, m.indices, m.data, rev_edge_ptr,
21809 : * source, sink) # <<<<<<<<<<<<<<
21810 : * else:
21811 : * raise ValueError('{} method is not supported yet.'.format(method))
21812 : */
21813 8 : __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_v_source); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L1_error)
21814 8 : __pyx_t_15 = __Pyx_PyInt_As_npy_int32(__pyx_v_sink); if (unlikely((__pyx_t_15 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L1_error)
21815 :
21816 : /* "scipy/sparse/csgraph/_flow.pyx":273
21817 : * m.data, rev_edge_ptr, source, sink)
21818 : * elif method == 'dinic':
21819 : * flow = _dinic(m.indptr, m.indices, m.data, rev_edge_ptr, # <<<<<<<<<<<<<<
21820 : * source, sink)
21821 : * else:
21822 : */
21823 8 : __pyx_t_21 = __pyx_f_5scipy_6sparse_7csgraph_5_flow__dinic(__pyx_t_18, __pyx_t_19, __pyx_t_17, __pyx_t_20, __pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 273, __pyx_L1_error)
21824 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
21825 8 : __pyx_t_18.memview = NULL; __pyx_t_18.data = NULL;
21826 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
21827 8 : __pyx_t_19.memview = NULL; __pyx_t_19.data = NULL;
21828 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
21829 8 : __pyx_t_17.memview = NULL; __pyx_t_17.data = NULL;
21830 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_20, 1);
21831 8 : __pyx_t_20.memview = NULL; __pyx_t_20.data = NULL;
21832 8 : __pyx_v_flow = __pyx_t_21;
21833 8 : __pyx_t_21.memview = NULL;
21834 8 : __pyx_t_21.data = NULL;
21835 :
21836 : /* "scipy/sparse/csgraph/_flow.pyx":272
21837 : * flow = _edmonds_karp(m.indptr, tails, m.indices,
21838 : * m.data, rev_edge_ptr, source, sink)
21839 : * elif method == 'dinic': # <<<<<<<<<<<<<<
21840 : * flow = _dinic(m.indptr, m.indices, m.data, rev_edge_ptr,
21841 : * source, sink)
21842 : */
21843 8 : goto __pyx_L20;
21844 : }
21845 :
21846 : /* "scipy/sparse/csgraph/_flow.pyx":276
21847 : * source, sink)
21848 : * else:
21849 : * raise ValueError('{} method is not supported yet.'.format(method)) # <<<<<<<<<<<<<<
21850 : * flow_array = np.asarray(flow)
21851 : * flow_matrix = csr_array((flow_array, m.indices, m.indptr), shape=m.shape)
21852 : */
21853 : /*else*/ {
21854 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_method_is_not_supported_yet, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
21855 0 : __Pyx_GOTREF(__pyx_t_2);
21856 0 : __pyx_t_3 = NULL;
21857 0 : __pyx_t_4 = 0;
21858 : #if CYTHON_UNPACK_METHODS
21859 0 : if (likely(PyMethod_Check(__pyx_t_2))) {
21860 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
21861 0 : if (likely(__pyx_t_3)) {
21862 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21863 0 : __Pyx_INCREF(__pyx_t_3);
21864 0 : __Pyx_INCREF(function);
21865 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
21866 : __pyx_t_4 = 1;
21867 : }
21868 : }
21869 : #endif
21870 : {
21871 0 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_method};
21872 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21873 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21874 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
21875 0 : __Pyx_GOTREF(__pyx_t_1);
21876 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21877 : }
21878 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
21879 0 : __Pyx_GOTREF(__pyx_t_2);
21880 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21881 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21882 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21883 0 : __PYX_ERR(0, 276, __pyx_L1_error)
21884 : }
21885 16 : __pyx_L20:;
21886 :
21887 : /* "scipy/sparse/csgraph/_flow.pyx":277
21888 : * else:
21889 : * raise ValueError('{} method is not supported yet.'.format(method))
21890 : * flow_array = np.asarray(flow) # <<<<<<<<<<<<<<
21891 : * flow_matrix = csr_array((flow_array, m.indices, m.indptr), shape=m.shape)
21892 : * if is_pydata_sparse:
21893 : */
21894 16 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
21895 16 : __Pyx_GOTREF(__pyx_t_1);
21896 16 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
21897 16 : __Pyx_GOTREF(__pyx_t_3);
21898 16 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21899 16 : __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_flow, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
21900 16 : __Pyx_GOTREF(__pyx_t_1);
21901 16 : __pyx_t_6 = NULL;
21902 16 : __pyx_t_4 = 0;
21903 : #if CYTHON_UNPACK_METHODS
21904 16 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
21905 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
21906 0 : if (likely(__pyx_t_6)) {
21907 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21908 0 : __Pyx_INCREF(__pyx_t_6);
21909 0 : __Pyx_INCREF(function);
21910 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
21911 : __pyx_t_4 = 1;
21912 : }
21913 : }
21914 : #endif
21915 : {
21916 16 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1};
21917 16 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
21918 16 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21919 16 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21920 16 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
21921 16 : __Pyx_GOTREF(__pyx_t_2);
21922 16 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21923 : }
21924 16 : __pyx_v_flow_array = __pyx_t_2;
21925 16 : __pyx_t_2 = 0;
21926 :
21927 : /* "scipy/sparse/csgraph/_flow.pyx":278
21928 : * raise ValueError('{} method is not supported yet.'.format(method))
21929 : * flow_array = np.asarray(flow)
21930 : * flow_matrix = csr_array((flow_array, m.indices, m.indptr), shape=m.shape) # <<<<<<<<<<<<<<
21931 : * if is_pydata_sparse:
21932 : * flow_matrix = pydata_sparse_cls.from_scipy_sparse(flow_matrix)
21933 : */
21934 16 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
21935 16 : __Pyx_GOTREF(__pyx_t_2);
21936 16 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
21937 16 : __Pyx_GOTREF(__pyx_t_3);
21938 16 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
21939 16 : __Pyx_GOTREF(__pyx_t_1);
21940 16 : __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
21941 16 : __Pyx_GOTREF(__pyx_t_6);
21942 16 : __Pyx_INCREF(__pyx_v_flow_array);
21943 16 : __Pyx_GIVEREF(__pyx_v_flow_array);
21944 16 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_flow_array)) __PYX_ERR(0, 278, __pyx_L1_error);
21945 16 : __Pyx_GIVEREF(__pyx_t_3);
21946 16 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error);
21947 16 : __Pyx_GIVEREF(__pyx_t_1);
21948 16 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error);
21949 16 : __pyx_t_3 = 0;
21950 16 : __pyx_t_1 = 0;
21951 16 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
21952 16 : __Pyx_GOTREF(__pyx_t_1);
21953 16 : __Pyx_GIVEREF(__pyx_t_6);
21954 16 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error);
21955 16 : __pyx_t_6 = 0;
21956 16 : __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
21957 16 : __Pyx_GOTREF(__pyx_t_6);
21958 16 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
21959 16 : __Pyx_GOTREF(__pyx_t_3);
21960 16 : if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
21961 16 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21962 16 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
21963 16 : __Pyx_GOTREF(__pyx_t_3);
21964 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21965 16 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21966 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21967 16 : __pyx_v_flow_matrix = __pyx_t_3;
21968 16 : __pyx_t_3 = 0;
21969 :
21970 : /* "scipy/sparse/csgraph/_flow.pyx":279
21971 : * flow_array = np.asarray(flow)
21972 : * flow_matrix = csr_array((flow_array, m.indices, m.indptr), shape=m.shape)
21973 : * if is_pydata_sparse: # <<<<<<<<<<<<<<
21974 : * flow_matrix = pydata_sparse_cls.from_scipy_sparse(flow_matrix)
21975 : * elif isinstance(csgraph_orig, csr_matrix):
21976 : */
21977 16 : __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_is_pydata_sparse); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 279, __pyx_L1_error)
21978 16 : if (__pyx_t_7) {
21979 :
21980 : /* "scipy/sparse/csgraph/_flow.pyx":280
21981 : * flow_matrix = csr_array((flow_array, m.indices, m.indptr), shape=m.shape)
21982 : * if is_pydata_sparse:
21983 : * flow_matrix = pydata_sparse_cls.from_scipy_sparse(flow_matrix) # <<<<<<<<<<<<<<
21984 : * elif isinstance(csgraph_orig, csr_matrix):
21985 : * flow_matrix = csr_matrix(flow_matrix)
21986 : */
21987 0 : if (unlikely(!__pyx_v_pydata_sparse_cls)) { __Pyx_RaiseUnboundLocalError("pydata_sparse_cls"); __PYX_ERR(0, 280, __pyx_L1_error) }
21988 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pydata_sparse_cls, __pyx_n_s_from_scipy_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error)
21989 0 : __Pyx_GOTREF(__pyx_t_6);
21990 0 : __pyx_t_1 = NULL;
21991 0 : __pyx_t_4 = 0;
21992 : #if CYTHON_UNPACK_METHODS
21993 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
21994 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
21995 0 : if (likely(__pyx_t_1)) {
21996 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
21997 0 : __Pyx_INCREF(__pyx_t_1);
21998 0 : __Pyx_INCREF(function);
21999 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
22000 : __pyx_t_4 = 1;
22001 : }
22002 : }
22003 : #endif
22004 : {
22005 0 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_flow_matrix};
22006 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22007 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22008 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
22009 0 : __Pyx_GOTREF(__pyx_t_3);
22010 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22011 : }
22012 0 : __Pyx_DECREF_SET(__pyx_v_flow_matrix, __pyx_t_3);
22013 0 : __pyx_t_3 = 0;
22014 :
22015 : /* "scipy/sparse/csgraph/_flow.pyx":279
22016 : * flow_array = np.asarray(flow)
22017 : * flow_matrix = csr_array((flow_array, m.indices, m.indptr), shape=m.shape)
22018 : * if is_pydata_sparse: # <<<<<<<<<<<<<<
22019 : * flow_matrix = pydata_sparse_cls.from_scipy_sparse(flow_matrix)
22020 : * elif isinstance(csgraph_orig, csr_matrix):
22021 : */
22022 0 : goto __pyx_L21;
22023 : }
22024 :
22025 : /* "scipy/sparse/csgraph/_flow.pyx":281
22026 : * if is_pydata_sparse:
22027 : * flow_matrix = pydata_sparse_cls.from_scipy_sparse(flow_matrix)
22028 : * elif isinstance(csgraph_orig, csr_matrix): # <<<<<<<<<<<<<<
22029 : * flow_matrix = csr_matrix(flow_matrix)
22030 : * source_flow = flow_array[m.indptr[source]:m.indptr[source + 1]]
22031 : */
22032 16 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
22033 16 : __Pyx_GOTREF(__pyx_t_3);
22034 16 : __pyx_t_7 = PyObject_IsInstance(__pyx_v_csgraph_orig, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 281, __pyx_L1_error)
22035 16 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22036 16 : if (__pyx_t_7) {
22037 :
22038 : /* "scipy/sparse/csgraph/_flow.pyx":282
22039 : * flow_matrix = pydata_sparse_cls.from_scipy_sparse(flow_matrix)
22040 : * elif isinstance(csgraph_orig, csr_matrix):
22041 : * flow_matrix = csr_matrix(flow_matrix) # <<<<<<<<<<<<<<
22042 : * source_flow = flow_array[m.indptr[source]:m.indptr[source + 1]]
22043 : * return MaximumFlowResult(source_flow.sum(), flow_matrix)
22044 : */
22045 2 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error)
22046 2 : __Pyx_GOTREF(__pyx_t_6);
22047 2 : __pyx_t_1 = NULL;
22048 2 : __pyx_t_4 = 0;
22049 : #if CYTHON_UNPACK_METHODS
22050 2 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
22051 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
22052 0 : if (likely(__pyx_t_1)) {
22053 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
22054 0 : __Pyx_INCREF(__pyx_t_1);
22055 0 : __Pyx_INCREF(function);
22056 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
22057 : __pyx_t_4 = 1;
22058 : }
22059 : }
22060 : #endif
22061 : {
22062 2 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_flow_matrix};
22063 2 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
22064 2 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22065 2 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
22066 2 : __Pyx_GOTREF(__pyx_t_3);
22067 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22068 : }
22069 2 : __Pyx_DECREF_SET(__pyx_v_flow_matrix, __pyx_t_3);
22070 16 : __pyx_t_3 = 0;
22071 :
22072 : /* "scipy/sparse/csgraph/_flow.pyx":281
22073 : * if is_pydata_sparse:
22074 : * flow_matrix = pydata_sparse_cls.from_scipy_sparse(flow_matrix)
22075 : * elif isinstance(csgraph_orig, csr_matrix): # <<<<<<<<<<<<<<
22076 : * flow_matrix = csr_matrix(flow_matrix)
22077 : * source_flow = flow_array[m.indptr[source]:m.indptr[source + 1]]
22078 : */
22079 : }
22080 14 : __pyx_L21:;
22081 :
22082 : /* "scipy/sparse/csgraph/_flow.pyx":283
22083 : * elif isinstance(csgraph_orig, csr_matrix):
22084 : * flow_matrix = csr_matrix(flow_matrix)
22085 : * source_flow = flow_array[m.indptr[source]:m.indptr[source + 1]] # <<<<<<<<<<<<<<
22086 : * return MaximumFlowResult(source_flow.sum(), flow_matrix)
22087 : *
22088 : */
22089 16 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
22090 16 : __Pyx_GOTREF(__pyx_t_3);
22091 16 : __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_source); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error)
22092 16 : __Pyx_GOTREF(__pyx_t_6);
22093 16 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22094 16 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
22095 16 : __Pyx_GOTREF(__pyx_t_3);
22096 16 : __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_source, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
22097 16 : __Pyx_GOTREF(__pyx_t_1);
22098 16 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
22099 16 : __Pyx_GOTREF(__pyx_t_2);
22100 16 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22101 16 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22102 16 : __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_flow_array, 0, 0, &__pyx_t_6, &__pyx_t_2, NULL, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
22103 16 : __Pyx_GOTREF(__pyx_t_1);
22104 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22105 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22106 16 : __pyx_v_source_flow = __pyx_t_1;
22107 16 : __pyx_t_1 = 0;
22108 :
22109 : /* "scipy/sparse/csgraph/_flow.pyx":284
22110 : * flow_matrix = csr_matrix(flow_matrix)
22111 : * source_flow = flow_array[m.indptr[source]:m.indptr[source + 1]]
22112 : * return MaximumFlowResult(source_flow.sum(), flow_matrix) # <<<<<<<<<<<<<<
22113 : *
22114 : *
22115 : */
22116 16 : __Pyx_XDECREF(__pyx_r);
22117 16 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MaximumFlowResult); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
22118 16 : __Pyx_GOTREF(__pyx_t_2);
22119 16 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source_flow, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
22120 16 : __Pyx_GOTREF(__pyx_t_3);
22121 16 : __pyx_t_8 = NULL;
22122 16 : __pyx_t_4 = 0;
22123 : #if CYTHON_UNPACK_METHODS
22124 16 : if (likely(PyMethod_Check(__pyx_t_3))) {
22125 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
22126 0 : if (likely(__pyx_t_8)) {
22127 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22128 0 : __Pyx_INCREF(__pyx_t_8);
22129 0 : __Pyx_INCREF(function);
22130 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
22131 : __pyx_t_4 = 1;
22132 : }
22133 : }
22134 : #endif
22135 : {
22136 16 : PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
22137 16 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
22138 16 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22139 16 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
22140 16 : __Pyx_GOTREF(__pyx_t_6);
22141 16 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22142 : }
22143 16 : __pyx_t_3 = NULL;
22144 16 : __pyx_t_4 = 0;
22145 : #if CYTHON_UNPACK_METHODS
22146 16 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
22147 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
22148 0 : if (likely(__pyx_t_3)) {
22149 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22150 0 : __Pyx_INCREF(__pyx_t_3);
22151 0 : __Pyx_INCREF(function);
22152 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
22153 : __pyx_t_4 = 1;
22154 : }
22155 : }
22156 : #endif
22157 : {
22158 16 : PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_v_flow_matrix};
22159 16 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
22160 16 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22161 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22162 16 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
22163 16 : __Pyx_GOTREF(__pyx_t_1);
22164 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22165 : }
22166 16 : __pyx_r = __pyx_t_1;
22167 16 : __pyx_t_1 = 0;
22168 16 : goto __pyx_L0;
22169 :
22170 : /* "scipy/sparse/csgraph/_flow.pyx":36
22171 : *
22172 : *
22173 : * def maximum_flow(csgraph, source, sink, *, method='dinic'): # <<<<<<<<<<<<<<
22174 : * r"""
22175 : * maximum_flow(csgraph, source, sink)
22176 : */
22177 :
22178 : /* function exit code */
22179 17 : __pyx_L1_error:;
22180 17 : __Pyx_XDECREF(__pyx_t_1);
22181 17 : __Pyx_XDECREF(__pyx_t_2);
22182 17 : __Pyx_XDECREF(__pyx_t_3);
22183 17 : __Pyx_XDECREF(__pyx_t_6);
22184 17 : __Pyx_XDECREF(__pyx_t_8);
22185 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_10, 1);
22186 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
22187 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_12, 1);
22188 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_13, 1);
22189 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
22190 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_17, 1);
22191 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
22192 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
22193 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_20, 1);
22194 17 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_21, 1);
22195 17 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow.maximum_flow", __pyx_clineno, __pyx_lineno, __pyx_filename);
22196 17 : __pyx_r = NULL;
22197 33 : __pyx_L0:;
22198 33 : __Pyx_XDECREF(__pyx_v_csgraph_orig);
22199 33 : __Pyx_XDECREF(__pyx_v_is_pydata_sparse);
22200 33 : __Pyx_XDECREF(__pyx_v_pydata_sparse_cls);
22201 33 : __Pyx_XDECREF(__pyx_v_csgraph_indices);
22202 33 : __Pyx_XDECREF(__pyx_v_csgraph_indptr);
22203 33 : __Pyx_XDECREF(__pyx_v_m);
22204 33 : __Pyx_XDECREF(__pyx_v_rev_edge_ptr);
22205 33 : __Pyx_XDECREF(__pyx_v_tails);
22206 33 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_flow, 1);
22207 33 : __Pyx_XDECREF(__pyx_v_flow_array);
22208 33 : __Pyx_XDECREF(__pyx_v_flow_matrix);
22209 33 : __Pyx_XDECREF(__pyx_v_source_flow);
22210 33 : __Pyx_XDECREF(__pyx_v_csgraph);
22211 33 : __Pyx_XGIVEREF(__pyx_r);
22212 33 : __Pyx_RefNannyFinishContext();
22213 33 : return __pyx_r;
22214 : }
22215 :
22216 : /* "scipy/sparse/csgraph/_flow.pyx":287
22217 : *
22218 : *
22219 : * def _add_reverse_edges(a): # <<<<<<<<<<<<<<
22220 : * """Add reversed edges to all edges in a graph.
22221 : *
22222 : */
22223 :
22224 : /* Python wrapper */
22225 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_3_add_reverse_edges(PyObject *__pyx_self,
22226 : #if CYTHON_METH_FASTCALL
22227 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22228 : #else
22229 : PyObject *__pyx_args, PyObject *__pyx_kwds
22230 : #endif
22231 : ); /*proto*/
22232 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_5_flow_2_add_reverse_edges, "Add reversed edges to all edges in a graph.\n\n This adds to a given directed weighted graph all edges in the reverse\n direction and give them weight 0, unless they already exist.\n\n Parameters\n ----------\n a : csr_array\n The square matrix in CSR format representing a directed graph\n\n Returns\n -------\n res : csr_array\n A new matrix in CSR format in which the missing edges are represented\n by explicit zeros.\n\n ");
22233 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_5_flow_3_add_reverse_edges = {"_add_reverse_edges", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_5_flow_3_add_reverse_edges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_5_flow_2_add_reverse_edges};
22234 20 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_3_add_reverse_edges(PyObject *__pyx_self,
22235 : #if CYTHON_METH_FASTCALL
22236 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22237 : #else
22238 : PyObject *__pyx_args, PyObject *__pyx_kwds
22239 : #endif
22240 : ) {
22241 20 : PyObject *__pyx_v_a = 0;
22242 : #if !CYTHON_METH_FASTCALL
22243 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22244 : #endif
22245 20 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22246 20 : PyObject* values[1] = {0};
22247 20 : int __pyx_lineno = 0;
22248 20 : const char *__pyx_filename = NULL;
22249 20 : int __pyx_clineno = 0;
22250 20 : PyObject *__pyx_r = 0;
22251 : __Pyx_RefNannyDeclarations
22252 20 : __Pyx_RefNannySetupContext("_add_reverse_edges (wrapper)", 0);
22253 : #if !CYTHON_METH_FASTCALL
22254 : #if CYTHON_ASSUME_SAFE_MACROS
22255 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22256 : #else
22257 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22258 : #endif
22259 : #endif
22260 20 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22261 : {
22262 20 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,0};
22263 20 : if (__pyx_kwds) {
22264 0 : Py_ssize_t kw_args;
22265 0 : switch (__pyx_nargs) {
22266 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22267 0 : CYTHON_FALLTHROUGH;
22268 0 : case 0: break;
22269 0 : default: goto __pyx_L5_argtuple_error;
22270 : }
22271 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
22272 0 : switch (__pyx_nargs) {
22273 : case 0:
22274 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
22275 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
22276 0 : kw_args--;
22277 : }
22278 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L3_error)
22279 0 : else goto __pyx_L5_argtuple_error;
22280 : }
22281 0 : if (unlikely(kw_args > 0)) {
22282 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
22283 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_add_reverse_edges") < 0)) __PYX_ERR(0, 287, __pyx_L3_error)
22284 : }
22285 20 : } else if (unlikely(__pyx_nargs != 1)) {
22286 0 : goto __pyx_L5_argtuple_error;
22287 : } else {
22288 20 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22289 : }
22290 20 : __pyx_v_a = values[0];
22291 : }
22292 20 : goto __pyx_L6_skip;
22293 0 : __pyx_L5_argtuple_error:;
22294 0 : __Pyx_RaiseArgtupleInvalid("_add_reverse_edges", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 287, __pyx_L3_error)
22295 20 : __pyx_L6_skip:;
22296 20 : goto __pyx_L4_argument_unpacking_done;
22297 0 : __pyx_L3_error:;
22298 : {
22299 0 : Py_ssize_t __pyx_temp;
22300 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22301 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22302 : }
22303 : }
22304 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._add_reverse_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
22305 0 : __Pyx_RefNannyFinishContext();
22306 0 : return NULL;
22307 20 : __pyx_L4_argument_unpacking_done:;
22308 20 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_5_flow_2_add_reverse_edges(__pyx_self, __pyx_v_a);
22309 :
22310 : /* function exit code */
22311 : {
22312 20 : Py_ssize_t __pyx_temp;
22313 20 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22314 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22315 : }
22316 : }
22317 : __Pyx_RefNannyFinishContext();
22318 : return __pyx_r;
22319 : }
22320 :
22321 20 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_2_add_reverse_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a) {
22322 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_n;
22323 20 : __Pyx_memviewslice __pyx_v_a_data_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22324 20 : __Pyx_memviewslice __pyx_v_a_indices_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22325 20 : __Pyx_memviewslice __pyx_v_a_indptr_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22326 20 : PyObject *__pyx_v_at = NULL;
22327 20 : __Pyx_memviewslice __pyx_v_at_indices_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22328 20 : __Pyx_memviewslice __pyx_v_at_indptr_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22329 20 : PyObject *__pyx_v_res_data = NULL;
22330 20 : __Pyx_memviewslice __pyx_v_res_data_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22331 20 : PyObject *__pyx_v_res_indices = NULL;
22332 20 : __Pyx_memviewslice __pyx_v_res_indices_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22333 20 : PyObject *__pyx_v_res_indptr = NULL;
22334 20 : __Pyx_memviewslice __pyx_v_res_indptr_view = { 0, 0, { 0 }, { 0 }, { 0 } };
22335 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_i;
22336 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_res_ptr;
22337 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_a_ptr;
22338 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_a_end;
22339 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_at_ptr;
22340 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_at_end;
22341 20 : int __pyx_v_move_a;
22342 20 : int __pyx_v_move_at;
22343 20 : PyObject *__pyx_r = NULL;
22344 : __Pyx_RefNannyDeclarations
22345 20 : PyObject *__pyx_t_1 = NULL;
22346 20 : PyObject *__pyx_t_2 = NULL;
22347 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_3;
22348 20 : __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
22349 20 : PyObject *__pyx_t_5 = NULL;
22350 20 : PyObject *__pyx_t_6 = NULL;
22351 20 : PyObject *__pyx_t_7 = NULL;
22352 20 : unsigned int __pyx_t_8;
22353 20 : int __pyx_t_9;
22354 20 : Py_ssize_t __pyx_t_10;
22355 20 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_11;
22356 20 : int __pyx_t_12;
22357 20 : Py_ssize_t __pyx_t_13;
22358 20 : PyObject *__pyx_t_14 = NULL;
22359 20 : int __pyx_lineno = 0;
22360 20 : const char *__pyx_filename = NULL;
22361 20 : int __pyx_clineno = 0;
22362 20 : __Pyx_RefNannySetupContext("_add_reverse_edges", 1);
22363 :
22364 : /* "scipy/sparse/csgraph/_flow.pyx":306
22365 : * """
22366 : * # Reference arrays of the input matrix.
22367 : * cdef ITYPE_t n = a.shape[0] # <<<<<<<<<<<<<<
22368 : * cdef ITYPE_t[:] a_data_view = a.data
22369 : * cdef ITYPE_t[:] a_indices_view = a.indices
22370 : */
22371 20 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
22372 20 : __Pyx_GOTREF(__pyx_t_1);
22373 20 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
22374 20 : __Pyx_GOTREF(__pyx_t_2);
22375 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22376 20 : __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
22377 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22378 20 : __pyx_v_n = __pyx_t_3;
22379 :
22380 : /* "scipy/sparse/csgraph/_flow.pyx":307
22381 : * # Reference arrays of the input matrix.
22382 : * cdef ITYPE_t n = a.shape[0]
22383 : * cdef ITYPE_t[:] a_data_view = a.data # <<<<<<<<<<<<<<
22384 : * cdef ITYPE_t[:] a_indices_view = a.indices
22385 : * cdef ITYPE_t[:] a_indptr_view = a.indptr
22386 : */
22387 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
22388 20 : __Pyx_GOTREF(__pyx_t_2);
22389 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 307, __pyx_L1_error)
22390 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22391 20 : __pyx_v_a_data_view = __pyx_t_4;
22392 20 : __pyx_t_4.memview = NULL;
22393 20 : __pyx_t_4.data = NULL;
22394 :
22395 : /* "scipy/sparse/csgraph/_flow.pyx":308
22396 : * cdef ITYPE_t n = a.shape[0]
22397 : * cdef ITYPE_t[:] a_data_view = a.data
22398 : * cdef ITYPE_t[:] a_indices_view = a.indices # <<<<<<<<<<<<<<
22399 : * cdef ITYPE_t[:] a_indptr_view = a.indptr
22400 : *
22401 : */
22402 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
22403 20 : __Pyx_GOTREF(__pyx_t_2);
22404 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 308, __pyx_L1_error)
22405 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22406 20 : __pyx_v_a_indices_view = __pyx_t_4;
22407 20 : __pyx_t_4.memview = NULL;
22408 20 : __pyx_t_4.data = NULL;
22409 :
22410 : /* "scipy/sparse/csgraph/_flow.pyx":309
22411 : * cdef ITYPE_t[:] a_data_view = a.data
22412 : * cdef ITYPE_t[:] a_indices_view = a.indices
22413 : * cdef ITYPE_t[:] a_indptr_view = a.indptr # <<<<<<<<<<<<<<
22414 : *
22415 : * # Create the transpose with the intent of using the resulting index
22416 : */
22417 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
22418 20 : __Pyx_GOTREF(__pyx_t_2);
22419 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 309, __pyx_L1_error)
22420 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22421 20 : __pyx_v_a_indptr_view = __pyx_t_4;
22422 20 : __pyx_t_4.memview = NULL;
22423 20 : __pyx_t_4.data = NULL;
22424 :
22425 : /* "scipy/sparse/csgraph/_flow.pyx":315
22426 : * # particular, we do not actually use the values in the transpose;
22427 : * # only the fact that the indices exist.
22428 : * at = csr_array(a.transpose()) # <<<<<<<<<<<<<<
22429 : * cdef ITYPE_t[:] at_indices_view = at.indices
22430 : * cdef ITYPE_t[:] at_indptr_view = at.indptr
22431 : */
22432 20 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
22433 20 : __Pyx_GOTREF(__pyx_t_1);
22434 20 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_transpose); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error)
22435 20 : __Pyx_GOTREF(__pyx_t_6);
22436 20 : __pyx_t_7 = NULL;
22437 20 : __pyx_t_8 = 0;
22438 : #if CYTHON_UNPACK_METHODS
22439 20 : if (likely(PyMethod_Check(__pyx_t_6))) {
22440 20 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
22441 20 : if (likely(__pyx_t_7)) {
22442 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
22443 20 : __Pyx_INCREF(__pyx_t_7);
22444 20 : __Pyx_INCREF(function);
22445 20 : __Pyx_DECREF_SET(__pyx_t_6, function);
22446 : __pyx_t_8 = 1;
22447 : }
22448 : }
22449 : #endif
22450 : {
22451 20 : PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
22452 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
22453 20 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22454 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
22455 20 : __Pyx_GOTREF(__pyx_t_5);
22456 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22457 : }
22458 20 : __pyx_t_6 = NULL;
22459 20 : __pyx_t_8 = 0;
22460 : #if CYTHON_UNPACK_METHODS
22461 20 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
22462 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
22463 0 : if (likely(__pyx_t_6)) {
22464 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22465 0 : __Pyx_INCREF(__pyx_t_6);
22466 0 : __Pyx_INCREF(function);
22467 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
22468 : __pyx_t_8 = 1;
22469 : }
22470 : }
22471 : #endif
22472 : {
22473 20 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
22474 20 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
22475 20 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22476 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22477 20 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
22478 20 : __Pyx_GOTREF(__pyx_t_2);
22479 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22480 : }
22481 20 : __pyx_v_at = __pyx_t_2;
22482 20 : __pyx_t_2 = 0;
22483 :
22484 : /* "scipy/sparse/csgraph/_flow.pyx":316
22485 : * # only the fact that the indices exist.
22486 : * at = csr_array(a.transpose())
22487 : * cdef ITYPE_t[:] at_indices_view = at.indices # <<<<<<<<<<<<<<
22488 : * cdef ITYPE_t[:] at_indptr_view = at.indptr
22489 : *
22490 : */
22491 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_at, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
22492 20 : __Pyx_GOTREF(__pyx_t_2);
22493 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 316, __pyx_L1_error)
22494 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22495 20 : __pyx_v_at_indices_view = __pyx_t_4;
22496 20 : __pyx_t_4.memview = NULL;
22497 20 : __pyx_t_4.data = NULL;
22498 :
22499 : /* "scipy/sparse/csgraph/_flow.pyx":317
22500 : * at = csr_array(a.transpose())
22501 : * cdef ITYPE_t[:] at_indices_view = at.indices
22502 : * cdef ITYPE_t[:] at_indptr_view = at.indptr # <<<<<<<<<<<<<<
22503 : *
22504 : * # Create arrays for the result matrix with added reverse edges. We
22505 : */
22506 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_at, __pyx_n_s_indptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
22507 20 : __Pyx_GOTREF(__pyx_t_2);
22508 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 317, __pyx_L1_error)
22509 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22510 20 : __pyx_v_at_indptr_view = __pyx_t_4;
22511 20 : __pyx_t_4.memview = NULL;
22512 20 : __pyx_t_4.data = NULL;
22513 :
22514 : /* "scipy/sparse/csgraph/_flow.pyx":325
22515 : * # a problem since csr_array implicitly truncates elements of data
22516 : * # and indices that go beyond the indices given by indptr.
22517 : * res_data = np.zeros(2 * a.nnz, ITYPE) # <<<<<<<<<<<<<<
22518 : * cdef ITYPE_t[:] res_data_view = res_data
22519 : * res_indices = np.zeros(2 * a.nnz, ITYPE)
22520 : */
22521 20 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
22522 20 : __Pyx_GOTREF(__pyx_t_1);
22523 20 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error)
22524 20 : __Pyx_GOTREF(__pyx_t_5);
22525 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22526 20 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
22527 20 : __Pyx_GOTREF(__pyx_t_1);
22528 20 : __pyx_t_6 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_t_1, 2, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
22529 20 : __Pyx_GOTREF(__pyx_t_6);
22530 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22531 20 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
22532 20 : __Pyx_GOTREF(__pyx_t_1);
22533 20 : __pyx_t_7 = NULL;
22534 20 : __pyx_t_8 = 0;
22535 : #if CYTHON_UNPACK_METHODS
22536 20 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
22537 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
22538 0 : if (likely(__pyx_t_7)) {
22539 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22540 0 : __Pyx_INCREF(__pyx_t_7);
22541 0 : __Pyx_INCREF(function);
22542 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22543 : __pyx_t_8 = 1;
22544 : }
22545 : }
22546 : #endif
22547 : {
22548 20 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_1};
22549 20 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
22550 20 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22551 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22552 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22553 20 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
22554 20 : __Pyx_GOTREF(__pyx_t_2);
22555 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22556 : }
22557 20 : __pyx_v_res_data = __pyx_t_2;
22558 20 : __pyx_t_2 = 0;
22559 :
22560 : /* "scipy/sparse/csgraph/_flow.pyx":326
22561 : * # and indices that go beyond the indices given by indptr.
22562 : * res_data = np.zeros(2 * a.nnz, ITYPE)
22563 : * cdef ITYPE_t[:] res_data_view = res_data # <<<<<<<<<<<<<<
22564 : * res_indices = np.zeros(2 * a.nnz, ITYPE)
22565 : * cdef ITYPE_t[:] res_indices_view = res_indices
22566 : */
22567 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_v_res_data, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 326, __pyx_L1_error)
22568 20 : __pyx_v_res_data_view = __pyx_t_4;
22569 20 : __pyx_t_4.memview = NULL;
22570 20 : __pyx_t_4.data = NULL;
22571 :
22572 : /* "scipy/sparse/csgraph/_flow.pyx":327
22573 : * res_data = np.zeros(2 * a.nnz, ITYPE)
22574 : * cdef ITYPE_t[:] res_data_view = res_data
22575 : * res_indices = np.zeros(2 * a.nnz, ITYPE) # <<<<<<<<<<<<<<
22576 : * cdef ITYPE_t[:] res_indices_view = res_indices
22577 : * res_indptr = np.zeros(n + 1, ITYPE)
22578 : */
22579 20 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
22580 20 : __Pyx_GOTREF(__pyx_t_5);
22581 20 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
22582 20 : __Pyx_GOTREF(__pyx_t_1);
22583 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22584 20 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_nnz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
22585 20 : __Pyx_GOTREF(__pyx_t_5);
22586 20 : __pyx_t_6 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_t_5, 2, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
22587 20 : __Pyx_GOTREF(__pyx_t_6);
22588 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22589 20 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
22590 20 : __Pyx_GOTREF(__pyx_t_5);
22591 20 : __pyx_t_7 = NULL;
22592 20 : __pyx_t_8 = 0;
22593 : #if CYTHON_UNPACK_METHODS
22594 20 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
22595 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
22596 0 : if (likely(__pyx_t_7)) {
22597 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22598 0 : __Pyx_INCREF(__pyx_t_7);
22599 0 : __Pyx_INCREF(function);
22600 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
22601 : __pyx_t_8 = 1;
22602 : }
22603 : }
22604 : #endif
22605 : {
22606 20 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_5};
22607 20 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
22608 20 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22609 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22610 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22611 20 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
22612 20 : __Pyx_GOTREF(__pyx_t_2);
22613 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22614 : }
22615 20 : __pyx_v_res_indices = __pyx_t_2;
22616 20 : __pyx_t_2 = 0;
22617 :
22618 : /* "scipy/sparse/csgraph/_flow.pyx":328
22619 : * cdef ITYPE_t[:] res_data_view = res_data
22620 : * res_indices = np.zeros(2 * a.nnz, ITYPE)
22621 : * cdef ITYPE_t[:] res_indices_view = res_indices # <<<<<<<<<<<<<<
22622 : * res_indptr = np.zeros(n + 1, ITYPE)
22623 : * cdef ITYPE_t[:] res_indptr_view = res_indptr
22624 : */
22625 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_v_res_indices, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 328, __pyx_L1_error)
22626 20 : __pyx_v_res_indices_view = __pyx_t_4;
22627 20 : __pyx_t_4.memview = NULL;
22628 20 : __pyx_t_4.data = NULL;
22629 :
22630 : /* "scipy/sparse/csgraph/_flow.pyx":329
22631 : * res_indices = np.zeros(2 * a.nnz, ITYPE)
22632 : * cdef ITYPE_t[:] res_indices_view = res_indices
22633 : * res_indptr = np.zeros(n + 1, ITYPE) # <<<<<<<<<<<<<<
22634 : * cdef ITYPE_t[:] res_indptr_view = res_indptr
22635 : *
22636 : */
22637 20 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
22638 20 : __Pyx_GOTREF(__pyx_t_1);
22639 20 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
22640 20 : __Pyx_GOTREF(__pyx_t_5);
22641 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22642 20 : __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
22643 20 : __Pyx_GOTREF(__pyx_t_1);
22644 20 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
22645 20 : __Pyx_GOTREF(__pyx_t_6);
22646 20 : __pyx_t_7 = NULL;
22647 20 : __pyx_t_8 = 0;
22648 : #if CYTHON_UNPACK_METHODS
22649 20 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
22650 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
22651 0 : if (likely(__pyx_t_7)) {
22652 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22653 0 : __Pyx_INCREF(__pyx_t_7);
22654 0 : __Pyx_INCREF(function);
22655 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
22656 : __pyx_t_8 = 1;
22657 : }
22658 : }
22659 : #endif
22660 : {
22661 20 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_6};
22662 20 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
22663 20 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22664 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22665 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22666 20 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
22667 20 : __Pyx_GOTREF(__pyx_t_2);
22668 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22669 : }
22670 20 : __pyx_v_res_indptr = __pyx_t_2;
22671 20 : __pyx_t_2 = 0;
22672 :
22673 : /* "scipy/sparse/csgraph/_flow.pyx":330
22674 : * cdef ITYPE_t[:] res_indices_view = res_indices
22675 : * res_indptr = np.zeros(n + 1, ITYPE)
22676 : * cdef ITYPE_t[:] res_indptr_view = res_indptr # <<<<<<<<<<<<<<
22677 : *
22678 : * cdef ITYPE_t i = 0
22679 : */
22680 20 : __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_v_res_indptr, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 330, __pyx_L1_error)
22681 20 : __pyx_v_res_indptr_view = __pyx_t_4;
22682 20 : __pyx_t_4.memview = NULL;
22683 20 : __pyx_t_4.data = NULL;
22684 :
22685 : /* "scipy/sparse/csgraph/_flow.pyx":332
22686 : * cdef ITYPE_t[:] res_indptr_view = res_indptr
22687 : *
22688 : * cdef ITYPE_t i = 0 # <<<<<<<<<<<<<<
22689 : * cdef ITYPE_t res_ptr = 0
22690 : * cdef ITYPE_t a_ptr, a_end, at_ptr, at_end
22691 : */
22692 20 : __pyx_v_i = 0;
22693 :
22694 : /* "scipy/sparse/csgraph/_flow.pyx":333
22695 : *
22696 : * cdef ITYPE_t i = 0
22697 : * cdef ITYPE_t res_ptr = 0 # <<<<<<<<<<<<<<
22698 : * cdef ITYPE_t a_ptr, a_end, at_ptr, at_end
22699 : * cdef bint move_a, move_at
22700 : */
22701 20 : __pyx_v_res_ptr = 0;
22702 :
22703 : /* "scipy/sparse/csgraph/_flow.pyx":337
22704 : * cdef bint move_a, move_at
22705 : * # Loop over all rows
22706 : * while i != n: # <<<<<<<<<<<<<<
22707 : * # For each row, to ensure that the resulting matrix has
22708 : * # sorted indices, we loop over the i'th rows in a and a.T
22709 : */
22710 400146 : while (1) {
22711 200083 : __pyx_t_9 = (__pyx_v_i != __pyx_v_n);
22712 200083 : if (!__pyx_t_9) break;
22713 :
22714 : /* "scipy/sparse/csgraph/_flow.pyx":342
22715 : * # simultaneously, bumping the pointer in one matrix only
22716 : * # if that wouldn't break the sorting.
22717 : * a_ptr, a_end = a_indptr_view[i], a_indptr_view[i + 1] # <<<<<<<<<<<<<<
22718 : * at_ptr, at_end = at_indptr_view[i], at_indptr_view[i + 1]
22719 : * while a_ptr != a_end or at_ptr != at_end:
22720 : */
22721 200063 : __pyx_t_10 = __pyx_v_i;
22722 200063 : __pyx_t_3 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_indptr_view.data + __pyx_t_10 * __pyx_v_a_indptr_view.strides[0]) )));
22723 200063 : __pyx_t_10 = (__pyx_v_i + 1);
22724 200063 : __pyx_t_11 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_indptr_view.data + __pyx_t_10 * __pyx_v_a_indptr_view.strides[0]) )));
22725 200063 : __pyx_v_a_ptr = __pyx_t_3;
22726 200063 : __pyx_v_a_end = __pyx_t_11;
22727 :
22728 : /* "scipy/sparse/csgraph/_flow.pyx":343
22729 : * # if that wouldn't break the sorting.
22730 : * a_ptr, a_end = a_indptr_view[i], a_indptr_view[i + 1]
22731 : * at_ptr, at_end = at_indptr_view[i], at_indptr_view[i + 1] # <<<<<<<<<<<<<<
22732 : * while a_ptr != a_end or at_ptr != at_end:
22733 : * move_a = a_ptr != a_end \
22734 : */
22735 200063 : __pyx_t_10 = __pyx_v_i;
22736 200063 : __pyx_t_11 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_at_indptr_view.data + __pyx_t_10 * __pyx_v_at_indptr_view.strides[0]) )));
22737 200063 : __pyx_t_10 = (__pyx_v_i + 1);
22738 200063 : __pyx_t_3 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_at_indptr_view.data + __pyx_t_10 * __pyx_v_at_indptr_view.strides[0]) )));
22739 200063 : __pyx_v_at_ptr = __pyx_t_11;
22740 200063 : __pyx_v_at_end = __pyx_t_3;
22741 :
22742 : /* "scipy/sparse/csgraph/_flow.pyx":344
22743 : * a_ptr, a_end = a_indptr_view[i], a_indptr_view[i + 1]
22744 : * at_ptr, at_end = at_indptr_view[i], at_indptr_view[i + 1]
22745 : * while a_ptr != a_end or at_ptr != at_end: # <<<<<<<<<<<<<<
22746 : * move_a = a_ptr != a_end \
22747 : * and (at_ptr == at_end
22748 : */
22749 1000285 : while (1) {
22750 600174 : __pyx_t_12 = (__pyx_v_a_ptr != __pyx_v_a_end);
22751 600174 : if (!__pyx_t_12) {
22752 200088 : } else {
22753 400086 : __pyx_t_9 = __pyx_t_12;
22754 400086 : goto __pyx_L7_bool_binop_done;
22755 : }
22756 200088 : __pyx_t_12 = (__pyx_v_at_ptr != __pyx_v_at_end);
22757 200088 : __pyx_t_9 = __pyx_t_12;
22758 600174 : __pyx_L7_bool_binop_done:;
22759 600174 : if (!__pyx_t_9) break;
22760 :
22761 : /* "scipy/sparse/csgraph/_flow.pyx":345
22762 : * at_ptr, at_end = at_indptr_view[i], at_indptr_view[i + 1]
22763 : * while a_ptr != a_end or at_ptr != at_end:
22764 : * move_a = a_ptr != a_end \ # <<<<<<<<<<<<<<
22765 : * and (at_ptr == at_end
22766 : * or a_indices_view[a_ptr] <= at_indices_view[at_ptr])
22767 : */
22768 400111 : __pyx_t_12 = (__pyx_v_a_ptr != __pyx_v_a_end);
22769 400111 : if (__pyx_t_12) {
22770 400086 : } else {
22771 25 : __pyx_t_9 = __pyx_t_12;
22772 25 : goto __pyx_L9_bool_binop_done;
22773 : }
22774 :
22775 : /* "scipy/sparse/csgraph/_flow.pyx":346
22776 : * while a_ptr != a_end or at_ptr != at_end:
22777 : * move_a = a_ptr != a_end \
22778 : * and (at_ptr == at_end # <<<<<<<<<<<<<<
22779 : * or a_indices_view[a_ptr] <= at_indices_view[at_ptr])
22780 : * move_at = at_ptr != at_end \
22781 : */
22782 400086 : __pyx_t_12 = (__pyx_v_at_ptr == __pyx_v_at_end);
22783 400086 : if (!__pyx_t_12) {
22784 200038 : } else {
22785 200048 : __pyx_t_9 = __pyx_t_12;
22786 200048 : goto __pyx_L9_bool_binop_done;
22787 : }
22788 :
22789 : /* "scipy/sparse/csgraph/_flow.pyx":347
22790 : * move_a = a_ptr != a_end \
22791 : * and (at_ptr == at_end
22792 : * or a_indices_view[a_ptr] <= at_indices_view[at_ptr]) # <<<<<<<<<<<<<<
22793 : * move_at = at_ptr != at_end \
22794 : * and (a_ptr == a_end
22795 : */
22796 200038 : __pyx_t_10 = __pyx_v_a_ptr;
22797 200038 : __pyx_t_13 = __pyx_v_at_ptr;
22798 200038 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_indices_view.data + __pyx_t_10 * __pyx_v_a_indices_view.strides[0]) ))) <= (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_at_indices_view.data + __pyx_t_13 * __pyx_v_at_indices_view.strides[0]) ))));
22799 200038 : __pyx_t_9 = __pyx_t_12;
22800 400111 : __pyx_L9_bool_binop_done:;
22801 400111 : __pyx_v_move_a = __pyx_t_9;
22802 :
22803 : /* "scipy/sparse/csgraph/_flow.pyx":348
22804 : * and (at_ptr == at_end
22805 : * or a_indices_view[a_ptr] <= at_indices_view[at_ptr])
22806 : * move_at = at_ptr != at_end \ # <<<<<<<<<<<<<<
22807 : * and (a_ptr == a_end
22808 : * or at_indices_view[at_ptr] <= a_indices_view[a_ptr])
22809 : */
22810 400111 : __pyx_t_12 = (__pyx_v_at_ptr != __pyx_v_at_end);
22811 400111 : if (__pyx_t_12) {
22812 200063 : } else {
22813 200048 : __pyx_t_9 = __pyx_t_12;
22814 200048 : goto __pyx_L12_bool_binop_done;
22815 : }
22816 :
22817 : /* "scipy/sparse/csgraph/_flow.pyx":349
22818 : * or a_indices_view[a_ptr] <= at_indices_view[at_ptr])
22819 : * move_at = at_ptr != at_end \
22820 : * and (a_ptr == a_end # <<<<<<<<<<<<<<
22821 : * or at_indices_view[at_ptr] <= a_indices_view[a_ptr])
22822 : * if move_a:
22823 : */
22824 200063 : __pyx_t_12 = (__pyx_v_a_ptr == __pyx_v_a_end);
22825 200063 : if (!__pyx_t_12) {
22826 200038 : } else {
22827 25 : __pyx_t_9 = __pyx_t_12;
22828 25 : goto __pyx_L12_bool_binop_done;
22829 : }
22830 :
22831 : /* "scipy/sparse/csgraph/_flow.pyx":350
22832 : * move_at = at_ptr != at_end \
22833 : * and (a_ptr == a_end
22834 : * or at_indices_view[at_ptr] <= a_indices_view[a_ptr]) # <<<<<<<<<<<<<<
22835 : * if move_a:
22836 : * # Note that it's possible that we move both pointers at once.
22837 : */
22838 200038 : __pyx_t_13 = __pyx_v_at_ptr;
22839 200038 : __pyx_t_10 = __pyx_v_a_ptr;
22840 200038 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_at_indices_view.data + __pyx_t_13 * __pyx_v_at_indices_view.strides[0]) ))) <= (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_indices_view.data + __pyx_t_10 * __pyx_v_a_indices_view.strides[0]) ))));
22841 200038 : __pyx_t_9 = __pyx_t_12;
22842 400111 : __pyx_L12_bool_binop_done:;
22843 400111 : __pyx_v_move_at = __pyx_t_9;
22844 :
22845 : /* "scipy/sparse/csgraph/_flow.pyx":351
22846 : * and (a_ptr == a_end
22847 : * or at_indices_view[at_ptr] <= a_indices_view[a_ptr])
22848 : * if move_a: # <<<<<<<<<<<<<<
22849 : * # Note that it's possible that we move both pointers at once.
22850 : * # In that case, we explicitly want the value from the original
22851 : */
22852 400111 : if (__pyx_v_move_a) {
22853 :
22854 : /* "scipy/sparse/csgraph/_flow.pyx":355
22855 : * # In that case, we explicitly want the value from the original
22856 : * # matrix.
22857 : * res_indices_view[res_ptr] = a_indices_view[a_ptr] # <<<<<<<<<<<<<<
22858 : * res_data_view[res_ptr] = a_data_view[a_ptr]
22859 : * a_ptr += 1
22860 : */
22861 200061 : __pyx_t_10 = __pyx_v_a_ptr;
22862 200061 : __pyx_t_13 = __pyx_v_res_ptr;
22863 200061 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_res_indices_view.data + __pyx_t_13 * __pyx_v_res_indices_view.strides[0]) )) = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_indices_view.data + __pyx_t_10 * __pyx_v_a_indices_view.strides[0]) )));
22864 :
22865 : /* "scipy/sparse/csgraph/_flow.pyx":356
22866 : * # matrix.
22867 : * res_indices_view[res_ptr] = a_indices_view[a_ptr]
22868 : * res_data_view[res_ptr] = a_data_view[a_ptr] # <<<<<<<<<<<<<<
22869 : * a_ptr += 1
22870 : * if move_at:
22871 : */
22872 200061 : __pyx_t_10 = __pyx_v_a_ptr;
22873 200061 : __pyx_t_13 = __pyx_v_res_ptr;
22874 200061 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_res_data_view.data + __pyx_t_13 * __pyx_v_res_data_view.strides[0]) )) = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_data_view.data + __pyx_t_10 * __pyx_v_a_data_view.strides[0]) )));
22875 :
22876 : /* "scipy/sparse/csgraph/_flow.pyx":357
22877 : * res_indices_view[res_ptr] = a_indices_view[a_ptr]
22878 : * res_data_view[res_ptr] = a_data_view[a_ptr]
22879 : * a_ptr += 1 # <<<<<<<<<<<<<<
22880 : * if move_at:
22881 : * res_indices_view[res_ptr] = at_indices_view[at_ptr]
22882 : */
22883 200061 : __pyx_v_a_ptr = (__pyx_v_a_ptr + 1);
22884 :
22885 : /* "scipy/sparse/csgraph/_flow.pyx":351
22886 : * and (a_ptr == a_end
22887 : * or at_indices_view[at_ptr] <= a_indices_view[a_ptr])
22888 : * if move_a: # <<<<<<<<<<<<<<
22889 : * # Note that it's possible that we move both pointers at once.
22890 : * # In that case, we explicitly want the value from the original
22891 : */
22892 : }
22893 :
22894 : /* "scipy/sparse/csgraph/_flow.pyx":358
22895 : * res_data_view[res_ptr] = a_data_view[a_ptr]
22896 : * a_ptr += 1
22897 : * if move_at: # <<<<<<<<<<<<<<
22898 : * res_indices_view[res_ptr] = at_indices_view[at_ptr]
22899 : * at_ptr += 1
22900 : */
22901 400111 : if (__pyx_v_move_at) {
22902 :
22903 : /* "scipy/sparse/csgraph/_flow.pyx":359
22904 : * a_ptr += 1
22905 : * if move_at:
22906 : * res_indices_view[res_ptr] = at_indices_view[at_ptr] # <<<<<<<<<<<<<<
22907 : * at_ptr += 1
22908 : * res_ptr += 1
22909 : */
22910 200061 : __pyx_t_10 = __pyx_v_at_ptr;
22911 200061 : __pyx_t_13 = __pyx_v_res_ptr;
22912 200061 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_res_indices_view.data + __pyx_t_13 * __pyx_v_res_indices_view.strides[0]) )) = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_at_indices_view.data + __pyx_t_10 * __pyx_v_at_indices_view.strides[0]) )));
22913 :
22914 : /* "scipy/sparse/csgraph/_flow.pyx":360
22915 : * if move_at:
22916 : * res_indices_view[res_ptr] = at_indices_view[at_ptr]
22917 : * at_ptr += 1 # <<<<<<<<<<<<<<
22918 : * res_ptr += 1
22919 : * i += 1
22920 : */
22921 200061 : __pyx_v_at_ptr = (__pyx_v_at_ptr + 1);
22922 :
22923 : /* "scipy/sparse/csgraph/_flow.pyx":358
22924 : * res_data_view[res_ptr] = a_data_view[a_ptr]
22925 : * a_ptr += 1
22926 : * if move_at: # <<<<<<<<<<<<<<
22927 : * res_indices_view[res_ptr] = at_indices_view[at_ptr]
22928 : * at_ptr += 1
22929 : */
22930 : }
22931 :
22932 : /* "scipy/sparse/csgraph/_flow.pyx":361
22933 : * res_indices_view[res_ptr] = at_indices_view[at_ptr]
22934 : * at_ptr += 1
22935 : * res_ptr += 1 # <<<<<<<<<<<<<<
22936 : * i += 1
22937 : * res_indptr_view[i] = res_ptr
22938 : */
22939 400111 : __pyx_v_res_ptr = (__pyx_v_res_ptr + 1);
22940 : }
22941 :
22942 : /* "scipy/sparse/csgraph/_flow.pyx":362
22943 : * at_ptr += 1
22944 : * res_ptr += 1
22945 : * i += 1 # <<<<<<<<<<<<<<
22946 : * res_indptr_view[i] = res_ptr
22947 : * return csr_array((res_data, res_indices, res_indptr), shape=(n, n))
22948 : */
22949 200063 : __pyx_v_i = (__pyx_v_i + 1);
22950 :
22951 : /* "scipy/sparse/csgraph/_flow.pyx":363
22952 : * res_ptr += 1
22953 : * i += 1
22954 : * res_indptr_view[i] = res_ptr # <<<<<<<<<<<<<<
22955 : * return csr_array((res_data, res_indices, res_indptr), shape=(n, n))
22956 : *
22957 : */
22958 200063 : __pyx_t_10 = __pyx_v_i;
22959 200063 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_res_indptr_view.data + __pyx_t_10 * __pyx_v_res_indptr_view.strides[0]) )) = __pyx_v_res_ptr;
22960 : }
22961 :
22962 : /* "scipy/sparse/csgraph/_flow.pyx":364
22963 : * i += 1
22964 : * res_indptr_view[i] = res_ptr
22965 : * return csr_array((res_data, res_indices, res_indptr), shape=(n, n)) # <<<<<<<<<<<<<<
22966 : *
22967 : *
22968 : */
22969 20 : __Pyx_XDECREF(__pyx_r);
22970 20 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
22971 20 : __Pyx_GOTREF(__pyx_t_2);
22972 20 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error)
22973 20 : __Pyx_GOTREF(__pyx_t_5);
22974 20 : __Pyx_INCREF(__pyx_v_res_data);
22975 20 : __Pyx_GIVEREF(__pyx_v_res_data);
22976 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_res_data)) __PYX_ERR(0, 364, __pyx_L1_error);
22977 20 : __Pyx_INCREF(__pyx_v_res_indices);
22978 20 : __Pyx_GIVEREF(__pyx_v_res_indices);
22979 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_res_indices)) __PYX_ERR(0, 364, __pyx_L1_error);
22980 20 : __Pyx_INCREF(__pyx_v_res_indptr);
22981 20 : __Pyx_GIVEREF(__pyx_v_res_indptr);
22982 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_res_indptr)) __PYX_ERR(0, 364, __pyx_L1_error);
22983 20 : __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error)
22984 20 : __Pyx_GOTREF(__pyx_t_6);
22985 20 : __Pyx_GIVEREF(__pyx_t_5);
22986 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error);
22987 20 : __pyx_t_5 = 0;
22988 20 : __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error)
22989 20 : __Pyx_GOTREF(__pyx_t_5);
22990 20 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
22991 20 : __Pyx_GOTREF(__pyx_t_1);
22992 20 : __pyx_t_7 = __Pyx_PyInt_From_npy_int32(__pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error)
22993 20 : __Pyx_GOTREF(__pyx_t_7);
22994 20 : __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 364, __pyx_L1_error)
22995 20 : __Pyx_GOTREF(__pyx_t_14);
22996 20 : __Pyx_GIVEREF(__pyx_t_1);
22997 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error);
22998 20 : __Pyx_GIVEREF(__pyx_t_7);
22999 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error);
23000 20 : __pyx_t_1 = 0;
23001 20 : __pyx_t_7 = 0;
23002 20 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_14) < 0) __PYX_ERR(0, 364, __pyx_L1_error)
23003 20 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23004 20 : __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 364, __pyx_L1_error)
23005 20 : __Pyx_GOTREF(__pyx_t_14);
23006 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23007 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23008 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23009 20 : __pyx_r = __pyx_t_14;
23010 20 : __pyx_t_14 = 0;
23011 20 : goto __pyx_L0;
23012 :
23013 : /* "scipy/sparse/csgraph/_flow.pyx":287
23014 : *
23015 : *
23016 : * def _add_reverse_edges(a): # <<<<<<<<<<<<<<
23017 : * """Add reversed edges to all edges in a graph.
23018 : *
23019 : */
23020 :
23021 : /* function exit code */
23022 0 : __pyx_L1_error:;
23023 0 : __Pyx_XDECREF(__pyx_t_1);
23024 0 : __Pyx_XDECREF(__pyx_t_2);
23025 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
23026 0 : __Pyx_XDECREF(__pyx_t_5);
23027 0 : __Pyx_XDECREF(__pyx_t_6);
23028 0 : __Pyx_XDECREF(__pyx_t_7);
23029 0 : __Pyx_XDECREF(__pyx_t_14);
23030 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._add_reverse_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
23031 0 : __pyx_r = NULL;
23032 20 : __pyx_L0:;
23033 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_a_data_view, 1);
23034 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_a_indices_view, 1);
23035 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_a_indptr_view, 1);
23036 20 : __Pyx_XDECREF(__pyx_v_at);
23037 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_at_indices_view, 1);
23038 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_at_indptr_view, 1);
23039 20 : __Pyx_XDECREF(__pyx_v_res_data);
23040 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_res_data_view, 1);
23041 20 : __Pyx_XDECREF(__pyx_v_res_indices);
23042 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_res_indices_view, 1);
23043 20 : __Pyx_XDECREF(__pyx_v_res_indptr);
23044 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_res_indptr_view, 1);
23045 20 : __Pyx_XGIVEREF(__pyx_r);
23046 20 : __Pyx_RefNannyFinishContext();
23047 20 : return __pyx_r;
23048 : }
23049 :
23050 : /* "scipy/sparse/csgraph/_flow.pyx":367
23051 : *
23052 : *
23053 : * def _make_edge_pointers(a): # <<<<<<<<<<<<<<
23054 : * """Create for each edge pointers to its reverse."""
23055 : * cdef int n = a.shape[0]
23056 : */
23057 :
23058 : /* Python wrapper */
23059 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_5_make_edge_pointers(PyObject *__pyx_self,
23060 : #if CYTHON_METH_FASTCALL
23061 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23062 : #else
23063 : PyObject *__pyx_args, PyObject *__pyx_kwds
23064 : #endif
23065 : ); /*proto*/
23066 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_5_flow_4_make_edge_pointers, "Create for each edge pointers to its reverse.");
23067 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_5_flow_5_make_edge_pointers = {"_make_edge_pointers", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_5_flow_5_make_edge_pointers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_5_flow_4_make_edge_pointers};
23068 21 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_5_make_edge_pointers(PyObject *__pyx_self,
23069 : #if CYTHON_METH_FASTCALL
23070 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23071 : #else
23072 : PyObject *__pyx_args, PyObject *__pyx_kwds
23073 : #endif
23074 : ) {
23075 21 : PyObject *__pyx_v_a = 0;
23076 : #if !CYTHON_METH_FASTCALL
23077 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23078 : #endif
23079 21 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23080 21 : PyObject* values[1] = {0};
23081 21 : int __pyx_lineno = 0;
23082 21 : const char *__pyx_filename = NULL;
23083 21 : int __pyx_clineno = 0;
23084 21 : PyObject *__pyx_r = 0;
23085 : __Pyx_RefNannyDeclarations
23086 21 : __Pyx_RefNannySetupContext("_make_edge_pointers (wrapper)", 0);
23087 : #if !CYTHON_METH_FASTCALL
23088 : #if CYTHON_ASSUME_SAFE_MACROS
23089 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23090 : #else
23091 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23092 : #endif
23093 : #endif
23094 21 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23095 : {
23096 21 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,0};
23097 21 : if (__pyx_kwds) {
23098 0 : Py_ssize_t kw_args;
23099 0 : switch (__pyx_nargs) {
23100 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
23101 0 : CYTHON_FALLTHROUGH;
23102 0 : case 0: break;
23103 0 : default: goto __pyx_L5_argtuple_error;
23104 : }
23105 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
23106 0 : switch (__pyx_nargs) {
23107 : case 0:
23108 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
23109 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
23110 0 : kw_args--;
23111 : }
23112 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
23113 0 : else goto __pyx_L5_argtuple_error;
23114 : }
23115 0 : if (unlikely(kw_args > 0)) {
23116 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
23117 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_make_edge_pointers") < 0)) __PYX_ERR(0, 367, __pyx_L3_error)
23118 : }
23119 21 : } else if (unlikely(__pyx_nargs != 1)) {
23120 0 : goto __pyx_L5_argtuple_error;
23121 : } else {
23122 21 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
23123 : }
23124 21 : __pyx_v_a = values[0];
23125 : }
23126 21 : goto __pyx_L6_skip;
23127 0 : __pyx_L5_argtuple_error:;
23128 0 : __Pyx_RaiseArgtupleInvalid("_make_edge_pointers", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 367, __pyx_L3_error)
23129 21 : __pyx_L6_skip:;
23130 21 : goto __pyx_L4_argument_unpacking_done;
23131 0 : __pyx_L3_error:;
23132 : {
23133 0 : Py_ssize_t __pyx_temp;
23134 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23135 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23136 : }
23137 : }
23138 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._make_edge_pointers", __pyx_clineno, __pyx_lineno, __pyx_filename);
23139 0 : __Pyx_RefNannyFinishContext();
23140 0 : return NULL;
23141 21 : __pyx_L4_argument_unpacking_done:;
23142 21 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_5_flow_4_make_edge_pointers(__pyx_self, __pyx_v_a);
23143 :
23144 : /* function exit code */
23145 : {
23146 21 : Py_ssize_t __pyx_temp;
23147 21 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23148 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23149 : }
23150 : }
23151 : __Pyx_RefNannyFinishContext();
23152 : return __pyx_r;
23153 : }
23154 :
23155 21 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_4_make_edge_pointers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a) {
23156 21 : int __pyx_v_n;
23157 21 : PyObject *__pyx_v_b_data = NULL;
23158 21 : PyObject *__pyx_v_b = NULL;
23159 21 : PyObject *__pyx_r = NULL;
23160 : __Pyx_RefNannyDeclarations
23161 21 : PyObject *__pyx_t_1 = NULL;
23162 21 : PyObject *__pyx_t_2 = NULL;
23163 21 : int __pyx_t_3;
23164 21 : PyObject *__pyx_t_4 = NULL;
23165 21 : PyObject *__pyx_t_5 = NULL;
23166 21 : PyObject *__pyx_t_6 = NULL;
23167 21 : PyObject *__pyx_t_7 = NULL;
23168 21 : unsigned int __pyx_t_8;
23169 21 : int __pyx_lineno = 0;
23170 21 : const char *__pyx_filename = NULL;
23171 21 : int __pyx_clineno = 0;
23172 21 : __Pyx_RefNannySetupContext("_make_edge_pointers", 1);
23173 :
23174 : /* "scipy/sparse/csgraph/_flow.pyx":369
23175 : * def _make_edge_pointers(a):
23176 : * """Create for each edge pointers to its reverse."""
23177 : * cdef int n = a.shape[0] # <<<<<<<<<<<<<<
23178 : * b_data = np.arange(a.data.shape[0], dtype=ITYPE)
23179 : * b = csr_array((b_data, a.indices, a.indptr), shape=(n, n), dtype=ITYPE)
23180 : */
23181 21 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
23182 21 : __Pyx_GOTREF(__pyx_t_1);
23183 21 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
23184 21 : __Pyx_GOTREF(__pyx_t_2);
23185 21 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23186 21 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
23187 21 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23188 21 : __pyx_v_n = __pyx_t_3;
23189 :
23190 : /* "scipy/sparse/csgraph/_flow.pyx":370
23191 : * """Create for each edge pointers to its reverse."""
23192 : * cdef int n = a.shape[0]
23193 : * b_data = np.arange(a.data.shape[0], dtype=ITYPE) # <<<<<<<<<<<<<<
23194 : * b = csr_array((b_data, a.indices, a.indptr), shape=(n, n), dtype=ITYPE)
23195 : * b = csr_array(b.transpose())
23196 : */
23197 21 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
23198 21 : __Pyx_GOTREF(__pyx_t_2);
23199 21 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
23200 21 : __Pyx_GOTREF(__pyx_t_1);
23201 21 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23202 21 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
23203 21 : __Pyx_GOTREF(__pyx_t_2);
23204 21 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
23205 21 : __Pyx_GOTREF(__pyx_t_4);
23206 21 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23207 21 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
23208 21 : __Pyx_GOTREF(__pyx_t_2);
23209 21 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23210 21 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
23211 21 : __Pyx_GOTREF(__pyx_t_4);
23212 21 : __Pyx_GIVEREF(__pyx_t_2);
23213 21 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error);
23214 21 : __pyx_t_2 = 0;
23215 21 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
23216 21 : __Pyx_GOTREF(__pyx_t_2);
23217 21 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
23218 21 : __Pyx_GOTREF(__pyx_t_5);
23219 21 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
23220 21 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23221 21 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
23222 21 : __Pyx_GOTREF(__pyx_t_5);
23223 21 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23224 21 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23225 21 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23226 21 : __pyx_v_b_data = __pyx_t_5;
23227 21 : __pyx_t_5 = 0;
23228 :
23229 : /* "scipy/sparse/csgraph/_flow.pyx":371
23230 : * cdef int n = a.shape[0]
23231 : * b_data = np.arange(a.data.shape[0], dtype=ITYPE)
23232 : * b = csr_array((b_data, a.indices, a.indptr), shape=(n, n), dtype=ITYPE) # <<<<<<<<<<<<<<
23233 : * b = csr_array(b.transpose())
23234 : * return b.data
23235 : */
23236 21 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
23237 21 : __Pyx_GOTREF(__pyx_t_5);
23238 21 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
23239 21 : __Pyx_GOTREF(__pyx_t_2);
23240 21 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_indptr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
23241 21 : __Pyx_GOTREF(__pyx_t_4);
23242 21 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
23243 21 : __Pyx_GOTREF(__pyx_t_1);
23244 21 : __Pyx_INCREF(__pyx_v_b_data);
23245 21 : __Pyx_GIVEREF(__pyx_v_b_data);
23246 21 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_b_data)) __PYX_ERR(0, 371, __pyx_L1_error);
23247 21 : __Pyx_GIVEREF(__pyx_t_2);
23248 21 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error);
23249 21 : __Pyx_GIVEREF(__pyx_t_4);
23250 21 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error);
23251 21 : __pyx_t_2 = 0;
23252 21 : __pyx_t_4 = 0;
23253 21 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
23254 21 : __Pyx_GOTREF(__pyx_t_4);
23255 21 : __Pyx_GIVEREF(__pyx_t_1);
23256 21 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error);
23257 21 : __pyx_t_1 = 0;
23258 21 : __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
23259 21 : __Pyx_GOTREF(__pyx_t_1);
23260 21 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
23261 21 : __Pyx_GOTREF(__pyx_t_2);
23262 21 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error)
23263 21 : __Pyx_GOTREF(__pyx_t_6);
23264 21 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
23265 21 : __Pyx_GOTREF(__pyx_t_7);
23266 21 : __Pyx_GIVEREF(__pyx_t_2);
23267 21 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error);
23268 21 : __Pyx_GIVEREF(__pyx_t_6);
23269 21 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error);
23270 21 : __pyx_t_2 = 0;
23271 21 : __pyx_t_6 = 0;
23272 21 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_7) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
23273 21 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23274 21 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
23275 21 : __Pyx_GOTREF(__pyx_t_7);
23276 21 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
23277 21 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23278 21 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
23279 21 : __Pyx_GOTREF(__pyx_t_7);
23280 21 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23281 21 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23282 21 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23283 21 : __pyx_v_b = __pyx_t_7;
23284 21 : __pyx_t_7 = 0;
23285 :
23286 : /* "scipy/sparse/csgraph/_flow.pyx":372
23287 : * b_data = np.arange(a.data.shape[0], dtype=ITYPE)
23288 : * b = csr_array((b_data, a.indices, a.indptr), shape=(n, n), dtype=ITYPE)
23289 : * b = csr_array(b.transpose()) # <<<<<<<<<<<<<<
23290 : * return b.data
23291 : *
23292 : */
23293 21 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
23294 21 : __Pyx_GOTREF(__pyx_t_1);
23295 21 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_transpose); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
23296 21 : __Pyx_GOTREF(__pyx_t_5);
23297 21 : __pyx_t_6 = NULL;
23298 21 : __pyx_t_8 = 0;
23299 : #if CYTHON_UNPACK_METHODS
23300 21 : if (likely(PyMethod_Check(__pyx_t_5))) {
23301 21 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
23302 21 : if (likely(__pyx_t_6)) {
23303 21 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
23304 21 : __Pyx_INCREF(__pyx_t_6);
23305 21 : __Pyx_INCREF(function);
23306 21 : __Pyx_DECREF_SET(__pyx_t_5, function);
23307 : __pyx_t_8 = 1;
23308 : }
23309 : }
23310 : #endif
23311 : {
23312 21 : PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
23313 21 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
23314 21 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23315 21 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
23316 21 : __Pyx_GOTREF(__pyx_t_4);
23317 21 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23318 : }
23319 21 : __pyx_t_5 = NULL;
23320 21 : __pyx_t_8 = 0;
23321 : #if CYTHON_UNPACK_METHODS
23322 21 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
23323 0 : __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
23324 0 : if (likely(__pyx_t_5)) {
23325 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23326 0 : __Pyx_INCREF(__pyx_t_5);
23327 0 : __Pyx_INCREF(function);
23328 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
23329 : __pyx_t_8 = 1;
23330 : }
23331 : }
23332 : #endif
23333 : {
23334 21 : PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
23335 21 : __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
23336 21 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23337 21 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23338 21 : if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error)
23339 21 : __Pyx_GOTREF(__pyx_t_7);
23340 21 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23341 : }
23342 21 : __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_7);
23343 21 : __pyx_t_7 = 0;
23344 :
23345 : /* "scipy/sparse/csgraph/_flow.pyx":373
23346 : * b = csr_array((b_data, a.indices, a.indptr), shape=(n, n), dtype=ITYPE)
23347 : * b = csr_array(b.transpose())
23348 : * return b.data # <<<<<<<<<<<<<<
23349 : *
23350 : *
23351 : */
23352 21 : __Pyx_XDECREF(__pyx_r);
23353 21 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error)
23354 21 : __Pyx_GOTREF(__pyx_t_7);
23355 21 : __pyx_r = __pyx_t_7;
23356 21 : __pyx_t_7 = 0;
23357 21 : goto __pyx_L0;
23358 :
23359 : /* "scipy/sparse/csgraph/_flow.pyx":367
23360 : *
23361 : *
23362 : * def _make_edge_pointers(a): # <<<<<<<<<<<<<<
23363 : * """Create for each edge pointers to its reverse."""
23364 : * cdef int n = a.shape[0]
23365 : */
23366 :
23367 : /* function exit code */
23368 0 : __pyx_L1_error:;
23369 0 : __Pyx_XDECREF(__pyx_t_1);
23370 0 : __Pyx_XDECREF(__pyx_t_2);
23371 0 : __Pyx_XDECREF(__pyx_t_4);
23372 0 : __Pyx_XDECREF(__pyx_t_5);
23373 0 : __Pyx_XDECREF(__pyx_t_6);
23374 0 : __Pyx_XDECREF(__pyx_t_7);
23375 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._make_edge_pointers", __pyx_clineno, __pyx_lineno, __pyx_filename);
23376 0 : __pyx_r = NULL;
23377 21 : __pyx_L0:;
23378 21 : __Pyx_XDECREF(__pyx_v_b_data);
23379 21 : __Pyx_XDECREF(__pyx_v_b);
23380 21 : __Pyx_XGIVEREF(__pyx_r);
23381 21 : __Pyx_RefNannyFinishContext();
23382 21 : return __pyx_r;
23383 : }
23384 :
23385 : /* "scipy/sparse/csgraph/_flow.pyx":376
23386 : *
23387 : *
23388 : * def _make_tails(a): # <<<<<<<<<<<<<<
23389 : * """Create for each edge pointers to its tail."""
23390 : * cdef int n = a.shape[0]
23391 : */
23392 :
23393 : /* Python wrapper */
23394 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_7_make_tails(PyObject *__pyx_self,
23395 : #if CYTHON_METH_FASTCALL
23396 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23397 : #else
23398 : PyObject *__pyx_args, PyObject *__pyx_kwds
23399 : #endif
23400 : ); /*proto*/
23401 : PyDoc_STRVAR(__pyx_doc_5scipy_6sparse_7csgraph_5_flow_6_make_tails, "Create for each edge pointers to its tail.");
23402 : static PyMethodDef __pyx_mdef_5scipy_6sparse_7csgraph_5_flow_7_make_tails = {"_make_tails", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6sparse_7csgraph_5_flow_7_make_tails, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6sparse_7csgraph_5_flow_6_make_tails};
23403 13 : static PyObject *__pyx_pw_5scipy_6sparse_7csgraph_5_flow_7_make_tails(PyObject *__pyx_self,
23404 : #if CYTHON_METH_FASTCALL
23405 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23406 : #else
23407 : PyObject *__pyx_args, PyObject *__pyx_kwds
23408 : #endif
23409 : ) {
23410 13 : PyObject *__pyx_v_a = 0;
23411 : #if !CYTHON_METH_FASTCALL
23412 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23413 : #endif
23414 13 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23415 13 : PyObject* values[1] = {0};
23416 13 : int __pyx_lineno = 0;
23417 13 : const char *__pyx_filename = NULL;
23418 13 : int __pyx_clineno = 0;
23419 13 : PyObject *__pyx_r = 0;
23420 : __Pyx_RefNannyDeclarations
23421 13 : __Pyx_RefNannySetupContext("_make_tails (wrapper)", 0);
23422 : #if !CYTHON_METH_FASTCALL
23423 : #if CYTHON_ASSUME_SAFE_MACROS
23424 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23425 : #else
23426 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23427 : #endif
23428 : #endif
23429 13 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23430 : {
23431 13 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,0};
23432 13 : if (__pyx_kwds) {
23433 0 : Py_ssize_t kw_args;
23434 0 : switch (__pyx_nargs) {
23435 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
23436 0 : CYTHON_FALLTHROUGH;
23437 0 : case 0: break;
23438 0 : default: goto __pyx_L5_argtuple_error;
23439 : }
23440 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
23441 0 : switch (__pyx_nargs) {
23442 : case 0:
23443 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
23444 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
23445 0 : kw_args--;
23446 : }
23447 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L3_error)
23448 0 : else goto __pyx_L5_argtuple_error;
23449 : }
23450 0 : if (unlikely(kw_args > 0)) {
23451 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
23452 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_make_tails") < 0)) __PYX_ERR(0, 376, __pyx_L3_error)
23453 : }
23454 13 : } else if (unlikely(__pyx_nargs != 1)) {
23455 0 : goto __pyx_L5_argtuple_error;
23456 : } else {
23457 13 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
23458 : }
23459 13 : __pyx_v_a = values[0];
23460 : }
23461 13 : goto __pyx_L6_skip;
23462 0 : __pyx_L5_argtuple_error:;
23463 0 : __Pyx_RaiseArgtupleInvalid("_make_tails", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 376, __pyx_L3_error)
23464 13 : __pyx_L6_skip:;
23465 13 : goto __pyx_L4_argument_unpacking_done;
23466 0 : __pyx_L3_error:;
23467 : {
23468 0 : Py_ssize_t __pyx_temp;
23469 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23470 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23471 : }
23472 : }
23473 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._make_tails", __pyx_clineno, __pyx_lineno, __pyx_filename);
23474 0 : __Pyx_RefNannyFinishContext();
23475 0 : return NULL;
23476 13 : __pyx_L4_argument_unpacking_done:;
23477 13 : __pyx_r = __pyx_pf_5scipy_6sparse_7csgraph_5_flow_6_make_tails(__pyx_self, __pyx_v_a);
23478 :
23479 : /* function exit code */
23480 : {
23481 13 : Py_ssize_t __pyx_temp;
23482 13 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23483 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23484 : }
23485 : }
23486 : __Pyx_RefNannyFinishContext();
23487 : return __pyx_r;
23488 : }
23489 :
23490 13 : static PyObject *__pyx_pf_5scipy_6sparse_7csgraph_5_flow_6_make_tails(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a) {
23491 13 : int __pyx_v_n;
23492 13 : __Pyx_memviewslice __pyx_v_tails = { 0, 0, { 0 }, { 0 }, { 0 } };
23493 13 : __Pyx_memviewslice __pyx_v_a_indptr_view = { 0, 0, { 0 }, { 0 }, { 0 } };
23494 13 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_i;
23495 13 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_j;
23496 13 : PyObject *__pyx_r = NULL;
23497 : __Pyx_RefNannyDeclarations
23498 13 : PyObject *__pyx_t_1 = NULL;
23499 13 : PyObject *__pyx_t_2 = NULL;
23500 13 : int __pyx_t_3;
23501 13 : PyObject *__pyx_t_4 = NULL;
23502 13 : PyObject *__pyx_t_5 = NULL;
23503 13 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
23504 13 : int __pyx_t_7;
23505 13 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_8;
23506 13 : Py_ssize_t __pyx_t_9;
23507 13 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_10;
23508 13 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_11;
23509 13 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_12;
23510 13 : Py_ssize_t __pyx_t_13;
23511 13 : int __pyx_lineno = 0;
23512 13 : const char *__pyx_filename = NULL;
23513 13 : int __pyx_clineno = 0;
23514 13 : __Pyx_RefNannySetupContext("_make_tails", 1);
23515 :
23516 : /* "scipy/sparse/csgraph/_flow.pyx":378
23517 : * def _make_tails(a):
23518 : * """Create for each edge pointers to its tail."""
23519 : * cdef int n = a.shape[0] # <<<<<<<<<<<<<<
23520 : * cdef ITYPE_t[:] tails = np.empty(a.data.shape[0], dtype=ITYPE)
23521 : * cdef ITYPE_t[:] a_indptr_view = a.indptr
23522 : */
23523 13 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
23524 13 : __Pyx_GOTREF(__pyx_t_1);
23525 13 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
23526 13 : __Pyx_GOTREF(__pyx_t_2);
23527 13 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23528 13 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error)
23529 13 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23530 13 : __pyx_v_n = __pyx_t_3;
23531 :
23532 : /* "scipy/sparse/csgraph/_flow.pyx":379
23533 : * """Create for each edge pointers to its tail."""
23534 : * cdef int n = a.shape[0]
23535 : * cdef ITYPE_t[:] tails = np.empty(a.data.shape[0], dtype=ITYPE) # <<<<<<<<<<<<<<
23536 : * cdef ITYPE_t[:] a_indptr_view = a.indptr
23537 : * cdef ITYPE_t i, j
23538 : */
23539 13 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
23540 13 : __Pyx_GOTREF(__pyx_t_2);
23541 13 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
23542 13 : __Pyx_GOTREF(__pyx_t_1);
23543 13 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23544 13 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
23545 13 : __Pyx_GOTREF(__pyx_t_2);
23546 13 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error)
23547 13 : __Pyx_GOTREF(__pyx_t_4);
23548 13 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23549 13 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
23550 13 : __Pyx_GOTREF(__pyx_t_2);
23551 13 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23552 13 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error)
23553 13 : __Pyx_GOTREF(__pyx_t_4);
23554 13 : __Pyx_GIVEREF(__pyx_t_2);
23555 13 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error);
23556 13 : __pyx_t_2 = 0;
23557 13 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
23558 13 : __Pyx_GOTREF(__pyx_t_2);
23559 13 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
23560 13 : __Pyx_GOTREF(__pyx_t_5);
23561 13 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 379, __pyx_L1_error)
23562 13 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23563 13 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
23564 13 : __Pyx_GOTREF(__pyx_t_5);
23565 13 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23566 13 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23567 13 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23568 13 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 379, __pyx_L1_error)
23569 13 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23570 13 : __pyx_v_tails = __pyx_t_6;
23571 13 : __pyx_t_6.memview = NULL;
23572 13 : __pyx_t_6.data = NULL;
23573 :
23574 : /* "scipy/sparse/csgraph/_flow.pyx":380
23575 : * cdef int n = a.shape[0]
23576 : * cdef ITYPE_t[:] tails = np.empty(a.data.shape[0], dtype=ITYPE)
23577 : * cdef ITYPE_t[:] a_indptr_view = a.indptr # <<<<<<<<<<<<<<
23578 : * cdef ITYPE_t i, j
23579 : * for i in range(n):
23580 : */
23581 13 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error)
23582 13 : __Pyx_GOTREF(__pyx_t_5);
23583 13 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 380, __pyx_L1_error)
23584 13 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23585 13 : __pyx_v_a_indptr_view = __pyx_t_6;
23586 13 : __pyx_t_6.memview = NULL;
23587 13 : __pyx_t_6.data = NULL;
23588 :
23589 : /* "scipy/sparse/csgraph/_flow.pyx":382
23590 : * cdef ITYPE_t[:] a_indptr_view = a.indptr
23591 : * cdef ITYPE_t i, j
23592 : * for i in range(n): # <<<<<<<<<<<<<<
23593 : * for j in range(a_indptr_view[i], a_indptr_view[i + 1]):
23594 : * tails[j] = i
23595 : */
23596 13 : __pyx_t_3 = __pyx_v_n;
23597 13 : __pyx_t_7 = __pyx_t_3;
23598 100048 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
23599 100035 : __pyx_v_i = __pyx_t_8;
23600 :
23601 : /* "scipy/sparse/csgraph/_flow.pyx":383
23602 : * cdef ITYPE_t i, j
23603 : * for i in range(n):
23604 : * for j in range(a_indptr_view[i], a_indptr_view[i + 1]): # <<<<<<<<<<<<<<
23605 : * tails[j] = i
23606 : * return tails
23607 : */
23608 100035 : __pyx_t_9 = (__pyx_v_i + 1);
23609 100035 : __pyx_t_10 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_indptr_view.data + __pyx_t_9 * __pyx_v_a_indptr_view.strides[0]) )));
23610 100035 : __pyx_t_9 = __pyx_v_i;
23611 100035 : __pyx_t_11 = __pyx_t_10;
23612 300092 : for (__pyx_t_12 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_a_indptr_view.data + __pyx_t_9 * __pyx_v_a_indptr_view.strides[0]) ))); __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
23613 200057 : __pyx_v_j = __pyx_t_12;
23614 :
23615 : /* "scipy/sparse/csgraph/_flow.pyx":384
23616 : * for i in range(n):
23617 : * for j in range(a_indptr_view[i], a_indptr_view[i + 1]):
23618 : * tails[j] = i # <<<<<<<<<<<<<<
23619 : * return tails
23620 : *
23621 : */
23622 200057 : __pyx_t_13 = __pyx_v_j;
23623 200057 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_tails.data + __pyx_t_13 * __pyx_v_tails.strides[0]) )) = __pyx_v_i;
23624 : }
23625 : }
23626 :
23627 : /* "scipy/sparse/csgraph/_flow.pyx":385
23628 : * for j in range(a_indptr_view[i], a_indptr_view[i + 1]):
23629 : * tails[j] = i
23630 : * return tails # <<<<<<<<<<<<<<
23631 : *
23632 : *
23633 : */
23634 13 : __Pyx_XDECREF(__pyx_r);
23635 13 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_tails, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error)
23636 13 : __Pyx_GOTREF(__pyx_t_5);
23637 13 : __pyx_r = __pyx_t_5;
23638 13 : __pyx_t_5 = 0;
23639 13 : goto __pyx_L0;
23640 :
23641 : /* "scipy/sparse/csgraph/_flow.pyx":376
23642 : *
23643 : *
23644 : * def _make_tails(a): # <<<<<<<<<<<<<<
23645 : * """Create for each edge pointers to its tail."""
23646 : * cdef int n = a.shape[0]
23647 : */
23648 :
23649 : /* function exit code */
23650 0 : __pyx_L1_error:;
23651 0 : __Pyx_XDECREF(__pyx_t_1);
23652 0 : __Pyx_XDECREF(__pyx_t_2);
23653 0 : __Pyx_XDECREF(__pyx_t_4);
23654 0 : __Pyx_XDECREF(__pyx_t_5);
23655 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
23656 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._make_tails", __pyx_clineno, __pyx_lineno, __pyx_filename);
23657 0 : __pyx_r = NULL;
23658 13 : __pyx_L0:;
23659 13 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_tails, 1);
23660 13 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_a_indptr_view, 1);
23661 13 : __Pyx_XGIVEREF(__pyx_r);
23662 13 : __Pyx_RefNannyFinishContext();
23663 13 : return __pyx_r;
23664 : }
23665 :
23666 : /* "scipy/sparse/csgraph/_flow.pyx":388
23667 : *
23668 : *
23669 : * cdef ITYPE_t[:] _edmonds_karp( # <<<<<<<<<<<<<<
23670 : * const ITYPE_t[:] edge_ptr,
23671 : * const ITYPE_t[:] tails,
23672 : */
23673 :
23674 8 : static __Pyx_memviewslice __pyx_f_5scipy_6sparse_7csgraph_5_flow__edmonds_karp(__Pyx_memviewslice __pyx_v_edge_ptr, __Pyx_memviewslice __pyx_v_tails, __Pyx_memviewslice __pyx_v_heads, __Pyx_memviewslice __pyx_v_capacities, __Pyx_memviewslice __pyx_v_rev_edge_ptr, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_source, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_sink) {
23675 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_n_verts;
23676 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_n_edges;
23677 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_ITYPE_MAX;
23678 8 : __Pyx_memviewslice __pyx_v_flow = { 0, 0, { 0 }, { 0 }, { 0 } };
23679 8 : __Pyx_memviewslice __pyx_v_q = { 0, 0, { 0 }, { 0 }, { 0 } };
23680 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_start;
23681 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_end;
23682 8 : __Pyx_memviewslice __pyx_v_pred_edge = { 0, 0, { 0 }, { 0 }, { 0 } };
23683 8 : int __pyx_v_path_found;
23684 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_cur;
23685 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_df;
23686 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_t;
23687 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_e;
23688 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_k;
23689 8 : __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
23690 : __Pyx_RefNannyDeclarations
23691 8 : PyObject *__pyx_t_1 = NULL;
23692 8 : PyObject *__pyx_t_2 = NULL;
23693 8 : PyObject *__pyx_t_3 = NULL;
23694 8 : PyObject *__pyx_t_4 = NULL;
23695 8 : unsigned int __pyx_t_5;
23696 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_6;
23697 8 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
23698 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_8;
23699 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_9;
23700 8 : Py_ssize_t __pyx_t_10;
23701 8 : int __pyx_t_11;
23702 8 : int __pyx_t_12;
23703 8 : Py_ssize_t __pyx_t_13;
23704 8 : Py_ssize_t __pyx_t_14;
23705 8 : int __pyx_lineno = 0;
23706 8 : const char *__pyx_filename = NULL;
23707 8 : int __pyx_clineno = 0;
23708 8 : __Pyx_RefNannySetupContext("_edmonds_karp", 1);
23709 :
23710 : /* "scipy/sparse/csgraph/_flow.pyx":426
23711 : *
23712 : * """
23713 : * cdef ITYPE_t n_verts = edge_ptr.shape[0] - 1 # <<<<<<<<<<<<<<
23714 : * cdef ITYPE_t n_edges = capacities.shape[0]
23715 : * cdef ITYPE_t ITYPE_MAX = np.iinfo(ITYPE).max
23716 : */
23717 8 : __pyx_v_n_verts = ((__pyx_v_edge_ptr.shape[0]) - 1);
23718 :
23719 : /* "scipy/sparse/csgraph/_flow.pyx":427
23720 : * """
23721 : * cdef ITYPE_t n_verts = edge_ptr.shape[0] - 1
23722 : * cdef ITYPE_t n_edges = capacities.shape[0] # <<<<<<<<<<<<<<
23723 : * cdef ITYPE_t ITYPE_MAX = np.iinfo(ITYPE).max
23724 : *
23725 : */
23726 8 : __pyx_v_n_edges = (__pyx_v_capacities.shape[0]);
23727 :
23728 : /* "scipy/sparse/csgraph/_flow.pyx":428
23729 : * cdef ITYPE_t n_verts = edge_ptr.shape[0] - 1
23730 : * cdef ITYPE_t n_edges = capacities.shape[0]
23731 : * cdef ITYPE_t ITYPE_MAX = np.iinfo(ITYPE).max # <<<<<<<<<<<<<<
23732 : *
23733 : * # Our result array will keep track of the flow along each edge
23734 : */
23735 8 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
23736 8 : __Pyx_GOTREF(__pyx_t_2);
23737 8 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_iinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
23738 8 : __Pyx_GOTREF(__pyx_t_3);
23739 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23740 8 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
23741 8 : __Pyx_GOTREF(__pyx_t_2);
23742 8 : __pyx_t_4 = NULL;
23743 8 : __pyx_t_5 = 0;
23744 : #if CYTHON_UNPACK_METHODS
23745 8 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
23746 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
23747 0 : if (likely(__pyx_t_4)) {
23748 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23749 0 : __Pyx_INCREF(__pyx_t_4);
23750 0 : __Pyx_INCREF(function);
23751 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
23752 : __pyx_t_5 = 1;
23753 : }
23754 : }
23755 : #endif
23756 : {
23757 8 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
23758 8 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
23759 8 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
23760 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23761 8 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
23762 8 : __Pyx_GOTREF(__pyx_t_1);
23763 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23764 : }
23765 8 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
23766 8 : __Pyx_GOTREF(__pyx_t_3);
23767 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23768 8 : __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_3); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
23769 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23770 8 : __pyx_v_ITYPE_MAX = __pyx_t_6;
23771 :
23772 : /* "scipy/sparse/csgraph/_flow.pyx":431
23773 : *
23774 : * # Our result array will keep track of the flow along each edge
23775 : * cdef ITYPE_t[:] flow = np.zeros(n_edges, dtype=ITYPE) # <<<<<<<<<<<<<<
23776 : *
23777 : * # Create a circular queue for breadth-first search. Elements are
23778 : */
23779 8 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
23780 8 : __Pyx_GOTREF(__pyx_t_3);
23781 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
23782 8 : __Pyx_GOTREF(__pyx_t_1);
23783 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23784 8 : __pyx_t_3 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
23785 8 : __Pyx_GOTREF(__pyx_t_3);
23786 8 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
23787 8 : __Pyx_GOTREF(__pyx_t_2);
23788 8 : __Pyx_GIVEREF(__pyx_t_3);
23789 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error);
23790 8 : __pyx_t_3 = 0;
23791 8 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
23792 8 : __Pyx_GOTREF(__pyx_t_3);
23793 8 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
23794 8 : __Pyx_GOTREF(__pyx_t_4);
23795 8 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
23796 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23797 8 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
23798 8 : __Pyx_GOTREF(__pyx_t_4);
23799 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23800 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23801 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23802 8 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 431, __pyx_L1_error)
23803 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23804 8 : __pyx_v_flow = __pyx_t_7;
23805 8 : __pyx_t_7.memview = NULL;
23806 8 : __pyx_t_7.data = NULL;
23807 :
23808 : /* "scipy/sparse/csgraph/_flow.pyx":435
23809 : * # Create a circular queue for breadth-first search. Elements are
23810 : * # popped dequeued at index start and queued at index end.
23811 : * cdef ITYPE_t[:] q = np.empty(n_verts, dtype=ITYPE) # <<<<<<<<<<<<<<
23812 : * cdef ITYPE_t start, end
23813 : *
23814 : */
23815 8 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
23816 8 : __Pyx_GOTREF(__pyx_t_4);
23817 8 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
23818 8 : __Pyx_GOTREF(__pyx_t_3);
23819 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23820 8 : __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_verts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
23821 8 : __Pyx_GOTREF(__pyx_t_4);
23822 8 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
23823 8 : __Pyx_GOTREF(__pyx_t_2);
23824 8 : __Pyx_GIVEREF(__pyx_t_4);
23825 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error);
23826 8 : __pyx_t_4 = 0;
23827 8 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
23828 8 : __Pyx_GOTREF(__pyx_t_4);
23829 8 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
23830 8 : __Pyx_GOTREF(__pyx_t_1);
23831 8 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
23832 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23833 8 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
23834 8 : __Pyx_GOTREF(__pyx_t_1);
23835 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23836 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23837 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23838 8 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 435, __pyx_L1_error)
23839 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23840 8 : __pyx_v_q = __pyx_t_7;
23841 8 : __pyx_t_7.memview = NULL;
23842 8 : __pyx_t_7.data = NULL;
23843 :
23844 : /* "scipy/sparse/csgraph/_flow.pyx":439
23845 : *
23846 : * # Create an array indexing predecessor edges
23847 : * cdef ITYPE_t[:] pred_edge = np.empty(n_verts, dtype=ITYPE) # <<<<<<<<<<<<<<
23848 : *
23849 : * cdef bint path_found
23850 : */
23851 8 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
23852 8 : __Pyx_GOTREF(__pyx_t_1);
23853 8 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
23854 8 : __Pyx_GOTREF(__pyx_t_4);
23855 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23856 8 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_verts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
23857 8 : __Pyx_GOTREF(__pyx_t_1);
23858 8 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
23859 8 : __Pyx_GOTREF(__pyx_t_2);
23860 8 : __Pyx_GIVEREF(__pyx_t_1);
23861 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error);
23862 8 : __pyx_t_1 = 0;
23863 8 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
23864 8 : __Pyx_GOTREF(__pyx_t_1);
23865 8 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
23866 8 : __Pyx_GOTREF(__pyx_t_3);
23867 8 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 439, __pyx_L1_error)
23868 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23869 8 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
23870 8 : __Pyx_GOTREF(__pyx_t_3);
23871 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23872 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23873 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23874 8 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 439, __pyx_L1_error)
23875 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23876 8 : __pyx_v_pred_edge = __pyx_t_7;
23877 8 : __pyx_t_7.memview = NULL;
23878 8 : __pyx_t_7.data = NULL;
23879 :
23880 : /* "scipy/sparse/csgraph/_flow.pyx":445
23881 : *
23882 : * # While augmenting paths from source to sink exist
23883 : * while True: # <<<<<<<<<<<<<<
23884 : * for k in range(n_verts):
23885 : * pred_edge[k] = -1
23886 : */
23887 28 : while (1) {
23888 :
23889 : /* "scipy/sparse/csgraph/_flow.pyx":446
23890 : * # While augmenting paths from source to sink exist
23891 : * while True:
23892 : * for k in range(n_verts): # <<<<<<<<<<<<<<
23893 : * pred_edge[k] = -1
23894 : * # Reset queue to consist only of source
23895 : */
23896 18 : __pyx_t_6 = __pyx_v_n_verts;
23897 18 : __pyx_t_8 = __pyx_t_6;
23898 200088 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23899 200070 : __pyx_v_k = __pyx_t_9;
23900 :
23901 : /* "scipy/sparse/csgraph/_flow.pyx":447
23902 : * while True:
23903 : * for k in range(n_verts):
23904 : * pred_edge[k] = -1 # <<<<<<<<<<<<<<
23905 : * # Reset queue to consist only of source
23906 : * q[0] = source
23907 : */
23908 200070 : __pyx_t_10 = __pyx_v_k;
23909 200070 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_pred_edge.data + __pyx_t_10 * __pyx_v_pred_edge.strides[0]) )) = -1;
23910 : }
23911 :
23912 : /* "scipy/sparse/csgraph/_flow.pyx":449
23913 : * pred_edge[k] = -1
23914 : * # Reset queue to consist only of source
23915 : * q[0] = source # <<<<<<<<<<<<<<
23916 : * start = 0
23917 : * end = 1
23918 : */
23919 18 : __pyx_t_10 = 0;
23920 18 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_10 * __pyx_v_q.strides[0]) )) = __pyx_v_source;
23921 :
23922 : /* "scipy/sparse/csgraph/_flow.pyx":450
23923 : * # Reset queue to consist only of source
23924 : * q[0] = source
23925 : * start = 0 # <<<<<<<<<<<<<<
23926 : * end = 1
23927 : * # While we have not found a path, and queue is not empty
23928 : */
23929 18 : __pyx_v_start = 0;
23930 :
23931 : /* "scipy/sparse/csgraph/_flow.pyx":451
23932 : * q[0] = source
23933 : * start = 0
23934 : * end = 1 # <<<<<<<<<<<<<<
23935 : * # While we have not found a path, and queue is not empty
23936 : * path_found = False
23937 : */
23938 18 : __pyx_v_end = 1;
23939 :
23940 : /* "scipy/sparse/csgraph/_flow.pyx":453
23941 : * end = 1
23942 : * # While we have not found a path, and queue is not empty
23943 : * path_found = False # <<<<<<<<<<<<<<
23944 : * while start != end and not path_found:
23945 : * # Pop queue
23946 : */
23947 18 : __pyx_v_path_found = 0;
23948 :
23949 : /* "scipy/sparse/csgraph/_flow.pyx":454
23950 : * # While we have not found a path, and queue is not empty
23951 : * path_found = False
23952 : * while start != end and not path_found: # <<<<<<<<<<<<<<
23953 : * # Pop queue
23954 : * cur = q[start]
23955 : */
23956 100060 : while (1) {
23957 100060 : __pyx_t_12 = (__pyx_v_start != __pyx_v_end);
23958 100060 : if (__pyx_t_12) {
23959 100045 : } else {
23960 15 : __pyx_t_11 = __pyx_t_12;
23961 15 : goto __pyx_L9_bool_binop_done;
23962 : }
23963 100045 : __pyx_t_12 = (!__pyx_v_path_found);
23964 100045 : __pyx_t_11 = __pyx_t_12;
23965 100060 : __pyx_L9_bool_binop_done:;
23966 100060 : if (!__pyx_t_11) break;
23967 :
23968 : /* "scipy/sparse/csgraph/_flow.pyx":456
23969 : * while start != end and not path_found:
23970 : * # Pop queue
23971 : * cur = q[start] # <<<<<<<<<<<<<<
23972 : * start += 1
23973 : * # Loop over all edges from the current vertex
23974 : */
23975 100042 : __pyx_t_10 = __pyx_v_start;
23976 100042 : __pyx_v_cur = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_10 * __pyx_v_q.strides[0]) )));
23977 :
23978 : /* "scipy/sparse/csgraph/_flow.pyx":457
23979 : * # Pop queue
23980 : * cur = q[start]
23981 : * start += 1 # <<<<<<<<<<<<<<
23982 : * # Loop over all edges from the current vertex
23983 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
23984 : */
23985 100042 : __pyx_v_start = (__pyx_v_start + 1);
23986 :
23987 : /* "scipy/sparse/csgraph/_flow.pyx":459
23988 : * start += 1
23989 : * # Loop over all edges from the current vertex
23990 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]): # <<<<<<<<<<<<<<
23991 : * t = heads[e]
23992 : * if pred_edge[t] == -1 and t != source and\
23993 : */
23994 100042 : __pyx_t_10 = (__pyx_v_cur + 1);
23995 100042 : __pyx_t_6 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_edge_ptr.data + __pyx_t_10 * __pyx_v_edge_ptr.strides[0]) )));
23996 100042 : __pyx_t_10 = __pyx_v_cur;
23997 100042 : __pyx_t_8 = __pyx_t_6;
23998 300127 : for (__pyx_t_9 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_edge_ptr.data + __pyx_t_10 * __pyx_v_edge_ptr.strides[0]) ))); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
23999 200095 : __pyx_v_e = __pyx_t_9;
24000 :
24001 : /* "scipy/sparse/csgraph/_flow.pyx":460
24002 : * # Loop over all edges from the current vertex
24003 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24004 : * t = heads[e] # <<<<<<<<<<<<<<
24005 : * if pred_edge[t] == -1 and t != source and\
24006 : * capacities[e] > flow[e]:
24007 : */
24008 200095 : __pyx_t_13 = __pyx_v_e;
24009 200095 : __pyx_v_t = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_heads.data + __pyx_t_13 * __pyx_v_heads.strides[0]) )));
24010 :
24011 : /* "scipy/sparse/csgraph/_flow.pyx":461
24012 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24013 : * t = heads[e]
24014 : * if pred_edge[t] == -1 and t != source and\ # <<<<<<<<<<<<<<
24015 : * capacities[e] > flow[e]:
24016 : * pred_edge[t] = e
24017 : */
24018 200095 : __pyx_t_13 = __pyx_v_t;
24019 200095 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_pred_edge.data + __pyx_t_13 * __pyx_v_pred_edge.strides[0]) ))) == -1L);
24020 200095 : if (__pyx_t_12) {
24021 100071 : } else {
24022 100024 : __pyx_t_11 = __pyx_t_12;
24023 100024 : goto __pyx_L14_bool_binop_done;
24024 : }
24025 100071 : __pyx_t_12 = (__pyx_v_t != __pyx_v_source);
24026 100071 : if (__pyx_t_12) {
24027 100055 : } else {
24028 16 : __pyx_t_11 = __pyx_t_12;
24029 16 : goto __pyx_L14_bool_binop_done;
24030 : }
24031 :
24032 : /* "scipy/sparse/csgraph/_flow.pyx":462
24033 : * t = heads[e]
24034 : * if pred_edge[t] == -1 and t != source and\
24035 : * capacities[e] > flow[e]: # <<<<<<<<<<<<<<
24036 : * pred_edge[t] = e
24037 : * if t == sink:
24038 : */
24039 100055 : __pyx_t_13 = __pyx_v_e;
24040 100055 : __pyx_t_14 = __pyx_v_e;
24041 100055 : __pyx_t_12 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_capacities.data + __pyx_t_13 * __pyx_v_capacities.strides[0]) ))) > (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_flow.data + __pyx_t_14 * __pyx_v_flow.strides[0]) ))));
24042 100055 : __pyx_t_11 = __pyx_t_12;
24043 200095 : __pyx_L14_bool_binop_done:;
24044 :
24045 : /* "scipy/sparse/csgraph/_flow.pyx":461
24046 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24047 : * t = heads[e]
24048 : * if pred_edge[t] == -1 and t != source and\ # <<<<<<<<<<<<<<
24049 : * capacities[e] > flow[e]:
24050 : * pred_edge[t] = e
24051 : */
24052 200095 : if (__pyx_t_11) {
24053 :
24054 : /* "scipy/sparse/csgraph/_flow.pyx":463
24055 : * if pred_edge[t] == -1 and t != source and\
24056 : * capacities[e] > flow[e]:
24057 : * pred_edge[t] = e # <<<<<<<<<<<<<<
24058 : * if t == sink:
24059 : * path_found = True
24060 : */
24061 100037 : __pyx_t_14 = __pyx_v_t;
24062 100037 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_pred_edge.data + __pyx_t_14 * __pyx_v_pred_edge.strides[0]) )) = __pyx_v_e;
24063 :
24064 : /* "scipy/sparse/csgraph/_flow.pyx":464
24065 : * capacities[e] > flow[e]:
24066 : * pred_edge[t] = e
24067 : * if t == sink: # <<<<<<<<<<<<<<
24068 : * path_found = True
24069 : * break
24070 : */
24071 100037 : __pyx_t_11 = (__pyx_v_t == __pyx_v_sink);
24072 100037 : if (__pyx_t_11) {
24073 :
24074 : /* "scipy/sparse/csgraph/_flow.pyx":465
24075 : * pred_edge[t] = e
24076 : * if t == sink:
24077 : * path_found = True # <<<<<<<<<<<<<<
24078 : * break
24079 : * # Push to queue
24080 : */
24081 10 : __pyx_v_path_found = 1;
24082 :
24083 : /* "scipy/sparse/csgraph/_flow.pyx":466
24084 : * if t == sink:
24085 : * path_found = True
24086 : * break # <<<<<<<<<<<<<<
24087 : * # Push to queue
24088 : * q[end] = t
24089 : */
24090 10 : goto __pyx_L12_break;
24091 :
24092 : /* "scipy/sparse/csgraph/_flow.pyx":464
24093 : * capacities[e] > flow[e]:
24094 : * pred_edge[t] = e
24095 : * if t == sink: # <<<<<<<<<<<<<<
24096 : * path_found = True
24097 : * break
24098 : */
24099 : }
24100 :
24101 : /* "scipy/sparse/csgraph/_flow.pyx":468
24102 : * break
24103 : * # Push to queue
24104 : * q[end] = t # <<<<<<<<<<<<<<
24105 : * end += 1
24106 : * # Did we find an augmenting path?
24107 : */
24108 100027 : __pyx_t_14 = __pyx_v_end;
24109 100027 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_14 * __pyx_v_q.strides[0]) )) = __pyx_v_t;
24110 :
24111 : /* "scipy/sparse/csgraph/_flow.pyx":469
24112 : * # Push to queue
24113 : * q[end] = t
24114 : * end += 1 # <<<<<<<<<<<<<<
24115 : * # Did we find an augmenting path?
24116 : * if path_found:
24117 : */
24118 100027 : __pyx_v_end = (__pyx_v_end + 1);
24119 :
24120 : /* "scipy/sparse/csgraph/_flow.pyx":461
24121 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24122 : * t = heads[e]
24123 : * if pred_edge[t] == -1 and t != source and\ # <<<<<<<<<<<<<<
24124 : * capacities[e] > flow[e]:
24125 : * pred_edge[t] = e
24126 : */
24127 : }
24128 : }
24129 100032 : __pyx_L12_break:;
24130 : }
24131 :
24132 : /* "scipy/sparse/csgraph/_flow.pyx":471
24133 : * end += 1
24134 : * # Did we find an augmenting path?
24135 : * if path_found: # <<<<<<<<<<<<<<
24136 : * df = ITYPE_MAX
24137 : * # Follow the path back from sink to source to find how
24138 : */
24139 18 : if (__pyx_v_path_found) {
24140 :
24141 : /* "scipy/sparse/csgraph/_flow.pyx":472
24142 : * # Did we find an augmenting path?
24143 : * if path_found:
24144 : * df = ITYPE_MAX # <<<<<<<<<<<<<<
24145 : * # Follow the path back from sink to source to find how
24146 : * # much flow can be pushed along the path.
24147 : */
24148 : __pyx_v_df = __pyx_v_ITYPE_MAX;
24149 :
24150 : /* "scipy/sparse/csgraph/_flow.pyx":475
24151 : * # Follow the path back from sink to source to find how
24152 : * # much flow can be pushed along the path.
24153 : * t = sink # <<<<<<<<<<<<<<
24154 : * while t != source:
24155 : * e = pred_edge[t]
24156 : */
24157 : __pyx_v_t = __pyx_v_sink;
24158 :
24159 : /* "scipy/sparse/csgraph/_flow.pyx":476
24160 : * # much flow can be pushed along the path.
24161 : * t = sink
24162 : * while t != source: # <<<<<<<<<<<<<<
24163 : * e = pred_edge[t]
24164 : * df = min(df, capacities[e] - flow[e])
24165 : */
24166 200058 : while (1) {
24167 100034 : __pyx_t_11 = (__pyx_v_t != __pyx_v_source);
24168 100034 : if (!__pyx_t_11) break;
24169 :
24170 : /* "scipy/sparse/csgraph/_flow.pyx":477
24171 : * t = sink
24172 : * while t != source:
24173 : * e = pred_edge[t] # <<<<<<<<<<<<<<
24174 : * df = min(df, capacities[e] - flow[e])
24175 : * t = tails[e]
24176 : */
24177 100024 : __pyx_t_10 = __pyx_v_t;
24178 100024 : __pyx_v_e = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_pred_edge.data + __pyx_t_10 * __pyx_v_pred_edge.strides[0]) )));
24179 :
24180 : /* "scipy/sparse/csgraph/_flow.pyx":478
24181 : * while t != source:
24182 : * e = pred_edge[t]
24183 : * df = min(df, capacities[e] - flow[e]) # <<<<<<<<<<<<<<
24184 : * t = tails[e]
24185 : * # Repeat the process, going from sink to source, but this
24186 : */
24187 100024 : __pyx_t_10 = __pyx_v_e;
24188 100024 : __pyx_t_14 = __pyx_v_e;
24189 100024 : __pyx_t_6 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_capacities.data + __pyx_t_10 * __pyx_v_capacities.strides[0]) ))) - (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_flow.data + __pyx_t_14 * __pyx_v_flow.strides[0]) ))));
24190 100024 : __pyx_t_8 = __pyx_v_df;
24191 100024 : __pyx_t_11 = (__pyx_t_6 < __pyx_t_8);
24192 100024 : if (__pyx_t_11) {
24193 : __pyx_t_9 = __pyx_t_6;
24194 : } else {
24195 : __pyx_t_9 = __pyx_t_8;
24196 : }
24197 100024 : __pyx_v_df = __pyx_t_9;
24198 :
24199 : /* "scipy/sparse/csgraph/_flow.pyx":479
24200 : * e = pred_edge[t]
24201 : * df = min(df, capacities[e] - flow[e])
24202 : * t = tails[e] # <<<<<<<<<<<<<<
24203 : * # Repeat the process, going from sink to source, but this
24204 : * # time push the flow that we found above.
24205 : */
24206 100024 : __pyx_t_14 = __pyx_v_e;
24207 100024 : __pyx_v_t = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_tails.data + __pyx_t_14 * __pyx_v_tails.strides[0]) )));
24208 : }
24209 :
24210 : /* "scipy/sparse/csgraph/_flow.pyx":482
24211 : * # Repeat the process, going from sink to source, but this
24212 : * # time push the flow that we found above.
24213 : * t = sink # <<<<<<<<<<<<<<
24214 : * while t != source:
24215 : * e = pred_edge[t]
24216 : */
24217 : __pyx_v_t = __pyx_v_sink;
24218 :
24219 : /* "scipy/sparse/csgraph/_flow.pyx":483
24220 : * # time push the flow that we found above.
24221 : * t = sink
24222 : * while t != source: # <<<<<<<<<<<<<<
24223 : * e = pred_edge[t]
24224 : * flow[e] += df
24225 : */
24226 200058 : while (1) {
24227 100034 : __pyx_t_11 = (__pyx_v_t != __pyx_v_source);
24228 100034 : if (!__pyx_t_11) break;
24229 :
24230 : /* "scipy/sparse/csgraph/_flow.pyx":484
24231 : * t = sink
24232 : * while t != source:
24233 : * e = pred_edge[t] # <<<<<<<<<<<<<<
24234 : * flow[e] += df
24235 : * flow[rev_edge_ptr[e]] -= df
24236 : */
24237 100024 : __pyx_t_14 = __pyx_v_t;
24238 100024 : __pyx_v_e = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_pred_edge.data + __pyx_t_14 * __pyx_v_pred_edge.strides[0]) )));
24239 :
24240 : /* "scipy/sparse/csgraph/_flow.pyx":485
24241 : * while t != source:
24242 : * e = pred_edge[t]
24243 : * flow[e] += df # <<<<<<<<<<<<<<
24244 : * flow[rev_edge_ptr[e]] -= df
24245 : * t = tails[e]
24246 : */
24247 100024 : __pyx_t_14 = __pyx_v_e;
24248 100024 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_flow.data + __pyx_t_14 * __pyx_v_flow.strides[0]) )) += __pyx_v_df;
24249 :
24250 : /* "scipy/sparse/csgraph/_flow.pyx":486
24251 : * e = pred_edge[t]
24252 : * flow[e] += df
24253 : * flow[rev_edge_ptr[e]] -= df # <<<<<<<<<<<<<<
24254 : * t = tails[e]
24255 : * else:
24256 : */
24257 100024 : __pyx_t_14 = __pyx_v_e;
24258 100024 : __pyx_t_10 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_rev_edge_ptr.data + __pyx_t_14 * __pyx_v_rev_edge_ptr.strides[0]) )));
24259 100024 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_flow.data + __pyx_t_10 * __pyx_v_flow.strides[0]) )) -= __pyx_v_df;
24260 :
24261 : /* "scipy/sparse/csgraph/_flow.pyx":487
24262 : * flow[e] += df
24263 : * flow[rev_edge_ptr[e]] -= df
24264 : * t = tails[e] # <<<<<<<<<<<<<<
24265 : * else:
24266 : * # If no augmenting path could be found, we're done.
24267 : */
24268 100024 : __pyx_t_14 = __pyx_v_e;
24269 100024 : __pyx_v_t = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_tails.data + __pyx_t_14 * __pyx_v_tails.strides[0]) )));
24270 : }
24271 :
24272 : /* "scipy/sparse/csgraph/_flow.pyx":471
24273 : * end += 1
24274 : * # Did we find an augmenting path?
24275 : * if path_found: # <<<<<<<<<<<<<<
24276 : * df = ITYPE_MAX
24277 : * # Follow the path back from sink to source to find how
24278 : */
24279 10 : goto __pyx_L18;
24280 : }
24281 :
24282 : /* "scipy/sparse/csgraph/_flow.pyx":490
24283 : * else:
24284 : * # If no augmenting path could be found, we're done.
24285 : * break # <<<<<<<<<<<<<<
24286 : * return flow
24287 : *
24288 : */
24289 : /*else*/ {
24290 8 : goto __pyx_L4_break;
24291 : }
24292 10 : __pyx_L18:;
24293 : }
24294 8 : __pyx_L4_break:;
24295 :
24296 : /* "scipy/sparse/csgraph/_flow.pyx":491
24297 : * # If no augmenting path could be found, we're done.
24298 : * break
24299 : * return flow # <<<<<<<<<<<<<<
24300 : *
24301 : * cdef bint _build_level_graph(
24302 : */
24303 8 : __PYX_INC_MEMVIEW(&__pyx_v_flow, 1);
24304 8 : __pyx_r = __pyx_v_flow;
24305 8 : goto __pyx_L0;
24306 :
24307 : /* "scipy/sparse/csgraph/_flow.pyx":388
24308 : *
24309 : *
24310 : * cdef ITYPE_t[:] _edmonds_karp( # <<<<<<<<<<<<<<
24311 : * const ITYPE_t[:] edge_ptr,
24312 : * const ITYPE_t[:] tails,
24313 : */
24314 :
24315 : /* function exit code */
24316 0 : __pyx_L1_error:;
24317 0 : __Pyx_XDECREF(__pyx_t_1);
24318 0 : __Pyx_XDECREF(__pyx_t_2);
24319 0 : __Pyx_XDECREF(__pyx_t_3);
24320 0 : __Pyx_XDECREF(__pyx_t_4);
24321 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
24322 0 : __pyx_r.data = NULL;
24323 0 : __pyx_r.memview = NULL;
24324 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._edmonds_karp", __pyx_clineno, __pyx_lineno, __pyx_filename);
24325 0 : goto __pyx_L2;
24326 8 : __pyx_L0:;
24327 8 : if (unlikely(!__pyx_r.memview)) {
24328 0 : PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
24329 : }
24330 8 : __pyx_L2:;
24331 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_flow, 1);
24332 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_q, 1);
24333 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_pred_edge, 1);
24334 8 : __Pyx_RefNannyFinishContext();
24335 8 : return __pyx_r;
24336 : }
24337 :
24338 : /* "scipy/sparse/csgraph/_flow.pyx":493
24339 : * return flow
24340 : *
24341 : * cdef bint _build_level_graph( # <<<<<<<<<<<<<<
24342 : * const ITYPE_t[:] edge_ptr, # IN
24343 : * const ITYPE_t source, # IN
24344 : */
24345 :
24346 17 : static int __pyx_f_5scipy_6sparse_7csgraph_5_flow__build_level_graph(__Pyx_memviewslice __pyx_v_edge_ptr, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_source, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_sink, __Pyx_memviewslice __pyx_v_capacities, __Pyx_memviewslice __pyx_v_heads, __Pyx_memviewslice __pyx_v_levels, __Pyx_memviewslice __pyx_v_q) {
24347 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_cur;
24348 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_start;
24349 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_end;
24350 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_dst_vertex;
24351 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_e;
24352 17 : int __pyx_r;
24353 17 : Py_ssize_t __pyx_t_1;
24354 17 : int __pyx_t_2;
24355 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_3;
24356 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_4;
24357 17 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_5;
24358 17 : Py_ssize_t __pyx_t_6;
24359 17 : int __pyx_t_7;
24360 17 : Py_ssize_t __pyx_t_8;
24361 :
24362 : /* "scipy/sparse/csgraph/_flow.pyx":533
24363 : * cdef ITYPE_t cur, start, end, dst_vertex, e
24364 : *
24365 : * q[0] = source # <<<<<<<<<<<<<<
24366 : * start = 0
24367 : * end = 1
24368 : */
24369 17 : __pyx_t_1 = 0;
24370 17 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_1 * __pyx_v_q.strides[0]) )) = __pyx_v_source;
24371 :
24372 : /* "scipy/sparse/csgraph/_flow.pyx":534
24373 : *
24374 : * q[0] = source
24375 : * start = 0 # <<<<<<<<<<<<<<
24376 : * end = 1
24377 : * levels[source] = 0
24378 : */
24379 17 : __pyx_v_start = 0;
24380 :
24381 : /* "scipy/sparse/csgraph/_flow.pyx":535
24382 : * q[0] = source
24383 : * start = 0
24384 : * end = 1 # <<<<<<<<<<<<<<
24385 : * levels[source] = 0
24386 : *
24387 : */
24388 17 : __pyx_v_end = 1;
24389 :
24390 : /* "scipy/sparse/csgraph/_flow.pyx":536
24391 : * start = 0
24392 : * end = 1
24393 : * levels[source] = 0 # <<<<<<<<<<<<<<
24394 : *
24395 : * while start != end:
24396 : */
24397 17 : __pyx_t_1 = __pyx_v_source;
24398 17 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_1 * __pyx_v_levels.strides[0]) )) = 0;
24399 :
24400 : /* "scipy/sparse/csgraph/_flow.pyx":538
24401 : * levels[source] = 0
24402 : *
24403 : * while start != end: # <<<<<<<<<<<<<<
24404 : * cur = q[start]
24405 : * start += 1
24406 : */
24407 100057 : while (1) {
24408 100057 : __pyx_t_2 = (__pyx_v_start != __pyx_v_end);
24409 100057 : if (!__pyx_t_2) break;
24410 :
24411 : /* "scipy/sparse/csgraph/_flow.pyx":539
24412 : *
24413 : * while start != end:
24414 : * cur = q[start] # <<<<<<<<<<<<<<
24415 : * start += 1
24416 : * if cur == sink:
24417 : */
24418 100049 : __pyx_t_1 = __pyx_v_start;
24419 100049 : __pyx_v_cur = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_1 * __pyx_v_q.strides[0]) )));
24420 :
24421 : /* "scipy/sparse/csgraph/_flow.pyx":540
24422 : * while start != end:
24423 : * cur = q[start]
24424 : * start += 1 # <<<<<<<<<<<<<<
24425 : * if cur == sink:
24426 : * return 1
24427 : */
24428 100049 : __pyx_v_start = (__pyx_v_start + 1);
24429 :
24430 : /* "scipy/sparse/csgraph/_flow.pyx":541
24431 : * cur = q[start]
24432 : * start += 1
24433 : * if cur == sink: # <<<<<<<<<<<<<<
24434 : * return 1
24435 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24436 : */
24437 100049 : __pyx_t_2 = (__pyx_v_cur == __pyx_v_sink);
24438 100049 : if (__pyx_t_2) {
24439 :
24440 : /* "scipy/sparse/csgraph/_flow.pyx":542
24441 : * start += 1
24442 : * if cur == sink:
24443 : * return 1 # <<<<<<<<<<<<<<
24444 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24445 : * dst_vertex = heads[e]
24446 : */
24447 9 : __pyx_r = 1;
24448 9 : goto __pyx_L0;
24449 :
24450 : /* "scipy/sparse/csgraph/_flow.pyx":541
24451 : * cur = q[start]
24452 : * start += 1
24453 : * if cur == sink: # <<<<<<<<<<<<<<
24454 : * return 1
24455 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24456 : */
24457 : }
24458 :
24459 : /* "scipy/sparse/csgraph/_flow.pyx":543
24460 : * if cur == sink:
24461 : * return 1
24462 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]): # <<<<<<<<<<<<<<
24463 : * dst_vertex = heads[e]
24464 : * if capacities[e] > 0 and levels[dst_vertex] == -1:
24465 : */
24466 100040 : __pyx_t_1 = (__pyx_v_cur + 1);
24467 100040 : __pyx_t_3 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_edge_ptr.data + __pyx_t_1 * __pyx_v_edge_ptr.strides[0]) )));
24468 100040 : __pyx_t_1 = __pyx_v_cur;
24469 100040 : __pyx_t_4 = __pyx_t_3;
24470 300128 : for (__pyx_t_5 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_edge_ptr.data + __pyx_t_1 * __pyx_v_edge_ptr.strides[0]) ))); __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
24471 200088 : __pyx_v_e = __pyx_t_5;
24472 :
24473 : /* "scipy/sparse/csgraph/_flow.pyx":544
24474 : * return 1
24475 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24476 : * dst_vertex = heads[e] # <<<<<<<<<<<<<<
24477 : * if capacities[e] > 0 and levels[dst_vertex] == -1:
24478 : * levels[dst_vertex] = levels[cur] + 1
24479 : */
24480 200088 : __pyx_t_6 = __pyx_v_e;
24481 200088 : __pyx_v_dst_vertex = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_heads.data + __pyx_t_6 * __pyx_v_heads.strides[0]) )));
24482 :
24483 : /* "scipy/sparse/csgraph/_flow.pyx":545
24484 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24485 : * dst_vertex = heads[e]
24486 : * if capacities[e] > 0 and levels[dst_vertex] == -1: # <<<<<<<<<<<<<<
24487 : * levels[dst_vertex] = levels[cur] + 1
24488 : * q[end] = dst_vertex
24489 : */
24490 200088 : __pyx_t_6 = __pyx_v_e;
24491 200088 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_capacities.data + __pyx_t_6 * __pyx_v_capacities.strides[0]) ))) > 0);
24492 200088 : if (__pyx_t_7) {
24493 100053 : } else {
24494 100035 : __pyx_t_2 = __pyx_t_7;
24495 100035 : goto __pyx_L9_bool_binop_done;
24496 : }
24497 100053 : __pyx_t_6 = __pyx_v_dst_vertex;
24498 100053 : __pyx_t_7 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_6 * __pyx_v_levels.strides[0]) ))) == -1L);
24499 100053 : __pyx_t_2 = __pyx_t_7;
24500 200088 : __pyx_L9_bool_binop_done:;
24501 200088 : if (__pyx_t_2) {
24502 :
24503 : /* "scipy/sparse/csgraph/_flow.pyx":546
24504 : * dst_vertex = heads[e]
24505 : * if capacities[e] > 0 and levels[dst_vertex] == -1:
24506 : * levels[dst_vertex] = levels[cur] + 1 # <<<<<<<<<<<<<<
24507 : * q[end] = dst_vertex
24508 : * end += 1
24509 : */
24510 100033 : __pyx_t_6 = __pyx_v_cur;
24511 100033 : __pyx_t_8 = __pyx_v_dst_vertex;
24512 100033 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_8 * __pyx_v_levels.strides[0]) )) = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_6 * __pyx_v_levels.strides[0]) ))) + 1);
24513 :
24514 : /* "scipy/sparse/csgraph/_flow.pyx":547
24515 : * if capacities[e] > 0 and levels[dst_vertex] == -1:
24516 : * levels[dst_vertex] = levels[cur] + 1
24517 : * q[end] = dst_vertex # <<<<<<<<<<<<<<
24518 : * end += 1
24519 : * return 0
24520 : */
24521 100033 : __pyx_t_6 = __pyx_v_end;
24522 100033 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_6 * __pyx_v_q.strides[0]) )) = __pyx_v_dst_vertex;
24523 :
24524 : /* "scipy/sparse/csgraph/_flow.pyx":548
24525 : * levels[dst_vertex] = levels[cur] + 1
24526 : * q[end] = dst_vertex
24527 : * end += 1 # <<<<<<<<<<<<<<
24528 : * return 0
24529 : *
24530 : */
24531 100033 : __pyx_v_end = (__pyx_v_end + 1);
24532 :
24533 : /* "scipy/sparse/csgraph/_flow.pyx":545
24534 : * for e in range(edge_ptr[cur], edge_ptr[cur + 1]):
24535 : * dst_vertex = heads[e]
24536 : * if capacities[e] > 0 and levels[dst_vertex] == -1: # <<<<<<<<<<<<<<
24537 : * levels[dst_vertex] = levels[cur] + 1
24538 : * q[end] = dst_vertex
24539 : */
24540 : }
24541 : }
24542 : }
24543 :
24544 : /* "scipy/sparse/csgraph/_flow.pyx":549
24545 : * q[end] = dst_vertex
24546 : * end += 1
24547 : * return 0 # <<<<<<<<<<<<<<
24548 : *
24549 : * cdef bint _augment_paths(
24550 : */
24551 8 : __pyx_r = 0;
24552 8 : goto __pyx_L0;
24553 :
24554 : /* "scipy/sparse/csgraph/_flow.pyx":493
24555 : * return flow
24556 : *
24557 : * cdef bint _build_level_graph( # <<<<<<<<<<<<<<
24558 : * const ITYPE_t[:] edge_ptr, # IN
24559 : * const ITYPE_t source, # IN
24560 : */
24561 :
24562 : /* function exit code */
24563 17 : __pyx_L0:;
24564 17 : return __pyx_r;
24565 : }
24566 :
24567 : /* "scipy/sparse/csgraph/_flow.pyx":551
24568 : * return 0
24569 : *
24570 : * cdef bint _augment_paths( # <<<<<<<<<<<<<<
24571 : * const ITYPE_t[:] edge_ptr, # IN
24572 : * const ITYPE_t source, # IN
24573 : */
24574 :
24575 19 : static int __pyx_f_5scipy_6sparse_7csgraph_5_flow__augment_paths(__Pyx_memviewslice __pyx_v_edge_ptr, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_source, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_sink, __Pyx_memviewslice __pyx_v_levels, __Pyx_memviewslice __pyx_v_heads, __Pyx_memviewslice __pyx_v_rev_edge_ptr, __Pyx_memviewslice __pyx_v_capacities, __Pyx_memviewslice __pyx_v_progress, __Pyx_memviewslice __pyx_v_flows, __Pyx_memviewslice __pyx_v_stack) {
24576 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_top;
24577 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_current;
24578 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_e;
24579 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_dst_vertex;
24580 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_current_flow;
24581 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_flow;
24582 19 : int __pyx_r;
24583 19 : Py_ssize_t __pyx_t_1;
24584 19 : Py_ssize_t __pyx_t_2;
24585 19 : int __pyx_t_3;
24586 19 : int __pyx_t_4;
24587 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_5;
24588 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_6;
24589 19 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_7;
24590 19 : Py_ssize_t __pyx_t_8;
24591 :
24592 : /* "scipy/sparse/csgraph/_flow.pyx":599
24593 : * """
24594 : * cdef ITYPE_t top, current, e, dst_vertex, current_flow, flow
24595 : * top = 0 # <<<<<<<<<<<<<<
24596 : * stack[top][0] = source
24597 : * stack[top][1] = 2147483647 # Max int
24598 : */
24599 19 : __pyx_v_top = 0;
24600 :
24601 : /* "scipy/sparse/csgraph/_flow.pyx":600
24602 : * cdef ITYPE_t top, current, e, dst_vertex, current_flow, flow
24603 : * top = 0
24604 : * stack[top][0] = source # <<<<<<<<<<<<<<
24605 : * stack[top][1] = 2147483647 # Max int
24606 : *
24607 : */
24608 19 : __pyx_t_1 = __pyx_v_top;
24609 19 : __pyx_t_2 = 0;
24610 19 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_1 * __pyx_v_stack.strides[0]) ) + __pyx_t_2 * __pyx_v_stack.strides[1]) )) = __pyx_v_source;
24611 :
24612 : /* "scipy/sparse/csgraph/_flow.pyx":601
24613 : * top = 0
24614 : * stack[top][0] = source
24615 : * stack[top][1] = 2147483647 # Max int # <<<<<<<<<<<<<<
24616 : *
24617 : * while True:
24618 : */
24619 19 : __pyx_t_2 = __pyx_v_top;
24620 19 : __pyx_t_1 = 1;
24621 19 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_2 * __pyx_v_stack.strides[0]) ) + __pyx_t_1 * __pyx_v_stack.strides[1]) )) = 0x7FFFFFFF;
24622 :
24623 : /* "scipy/sparse/csgraph/_flow.pyx":603
24624 : * stack[top][1] = 2147483647 # Max int
24625 : *
24626 : * while True: # <<<<<<<<<<<<<<
24627 : * current = stack[top][0]
24628 : * flow = stack[top][1]
24629 : */
24630 200077 : while (1) {
24631 :
24632 : /* "scipy/sparse/csgraph/_flow.pyx":604
24633 : *
24634 : * while True:
24635 : * current = stack[top][0] # <<<<<<<<<<<<<<
24636 : * flow = stack[top][1]
24637 : * e = progress[current]
24638 : */
24639 200077 : __pyx_t_1 = __pyx_v_top;
24640 200077 : __pyx_t_2 = 0;
24641 200077 : __pyx_v_current = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_1 * __pyx_v_stack.strides[0]) ) + __pyx_t_2 * __pyx_v_stack.strides[1]) )));
24642 :
24643 : /* "scipy/sparse/csgraph/_flow.pyx":605
24644 : * while True:
24645 : * current = stack[top][0]
24646 : * flow = stack[top][1] # <<<<<<<<<<<<<<
24647 : * e = progress[current]
24648 : * dst_vertex = heads[e]
24649 : */
24650 200077 : __pyx_t_2 = __pyx_v_top;
24651 200077 : __pyx_t_1 = 1;
24652 200077 : __pyx_v_flow = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_2 * __pyx_v_stack.strides[0]) ) + __pyx_t_1 * __pyx_v_stack.strides[1]) )));
24653 :
24654 : /* "scipy/sparse/csgraph/_flow.pyx":606
24655 : * current = stack[top][0]
24656 : * flow = stack[top][1]
24657 : * e = progress[current] # <<<<<<<<<<<<<<
24658 : * dst_vertex = heads[e]
24659 : * if (capacities[e] > 0 and
24660 : */
24661 200077 : __pyx_t_1 = __pyx_v_current;
24662 200077 : __pyx_v_e = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_progress.data + __pyx_t_1 * __pyx_v_progress.strides[0]) )));
24663 :
24664 : /* "scipy/sparse/csgraph/_flow.pyx":607
24665 : * flow = stack[top][1]
24666 : * e = progress[current]
24667 : * dst_vertex = heads[e] # <<<<<<<<<<<<<<
24668 : * if (capacities[e] > 0 and
24669 : * levels[dst_vertex] == levels[current] + 1):
24670 : */
24671 200077 : __pyx_t_1 = __pyx_v_e;
24672 200077 : __pyx_v_dst_vertex = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_heads.data + __pyx_t_1 * __pyx_v_heads.strides[0]) )));
24673 :
24674 : /* "scipy/sparse/csgraph/_flow.pyx":608
24675 : * e = progress[current]
24676 : * dst_vertex = heads[e]
24677 : * if (capacities[e] > 0 and # <<<<<<<<<<<<<<
24678 : * levels[dst_vertex] == levels[current] + 1):
24679 : * current_flow = min(flow, capacities[e])
24680 : */
24681 200077 : __pyx_t_1 = __pyx_v_e;
24682 200077 : __pyx_t_4 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_capacities.data + __pyx_t_1 * __pyx_v_capacities.strides[0]) ))) > 0);
24683 200077 : if (__pyx_t_4) {
24684 100046 : } else {
24685 100031 : __pyx_t_3 = __pyx_t_4;
24686 100031 : goto __pyx_L6_bool_binop_done;
24687 : }
24688 :
24689 : /* "scipy/sparse/csgraph/_flow.pyx":609
24690 : * dst_vertex = heads[e]
24691 : * if (capacities[e] > 0 and
24692 : * levels[dst_vertex] == levels[current] + 1): # <<<<<<<<<<<<<<
24693 : * current_flow = min(flow, capacities[e])
24694 : * if dst_vertex == sink:
24695 : */
24696 100046 : __pyx_t_1 = __pyx_v_dst_vertex;
24697 100046 : __pyx_t_2 = __pyx_v_current;
24698 100046 : __pyx_t_4 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_1 * __pyx_v_levels.strides[0]) ))) == ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_2 * __pyx_v_levels.strides[0]) ))) + 1));
24699 100046 : __pyx_t_3 = __pyx_t_4;
24700 200077 : __pyx_L6_bool_binop_done:;
24701 :
24702 : /* "scipy/sparse/csgraph/_flow.pyx":608
24703 : * e = progress[current]
24704 : * dst_vertex = heads[e]
24705 : * if (capacities[e] > 0 and # <<<<<<<<<<<<<<
24706 : * levels[dst_vertex] == levels[current] + 1):
24707 : * current_flow = min(flow, capacities[e])
24708 : */
24709 200077 : if (__pyx_t_3) {
24710 :
24711 : /* "scipy/sparse/csgraph/_flow.pyx":610
24712 : * if (capacities[e] > 0 and
24713 : * levels[dst_vertex] == levels[current] + 1):
24714 : * current_flow = min(flow, capacities[e]) # <<<<<<<<<<<<<<
24715 : * if dst_vertex == sink:
24716 : * while top > -1:
24717 : */
24718 100033 : __pyx_t_2 = __pyx_v_e;
24719 100033 : __pyx_t_5 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_capacities.data + __pyx_t_2 * __pyx_v_capacities.strides[0]) )));
24720 100033 : __pyx_t_6 = __pyx_v_flow;
24721 100033 : __pyx_t_3 = (__pyx_t_5 < __pyx_t_6);
24722 100033 : if (__pyx_t_3) {
24723 : __pyx_t_7 = __pyx_t_5;
24724 : } else {
24725 : __pyx_t_7 = __pyx_t_6;
24726 : }
24727 100033 : __pyx_v_current_flow = __pyx_t_7;
24728 :
24729 : /* "scipy/sparse/csgraph/_flow.pyx":611
24730 : * levels[dst_vertex] == levels[current] + 1):
24731 : * current_flow = min(flow, capacities[e])
24732 : * if dst_vertex == sink: # <<<<<<<<<<<<<<
24733 : * while top > -1:
24734 : * e = progress[stack[top][0]]
24735 : */
24736 100033 : __pyx_t_3 = (__pyx_v_dst_vertex == __pyx_v_sink);
24737 100033 : if (__pyx_t_3) {
24738 :
24739 : /* "scipy/sparse/csgraph/_flow.pyx":612
24740 : * current_flow = min(flow, capacities[e])
24741 : * if dst_vertex == sink:
24742 : * while top > -1: # <<<<<<<<<<<<<<
24743 : * e = progress[stack[top][0]]
24744 : * capacities[e] -= current_flow
24745 : */
24746 200058 : while (1) {
24747 100034 : __pyx_t_3 = (__pyx_v_top > -1L);
24748 100034 : if (!__pyx_t_3) break;
24749 :
24750 : /* "scipy/sparse/csgraph/_flow.pyx":613
24751 : * if dst_vertex == sink:
24752 : * while top > -1:
24753 : * e = progress[stack[top][0]] # <<<<<<<<<<<<<<
24754 : * capacities[e] -= current_flow
24755 : * capacities[rev_edge_ptr[e]] += current_flow
24756 : */
24757 100024 : __pyx_t_2 = __pyx_v_top;
24758 100024 : __pyx_t_1 = 0;
24759 100024 : __pyx_t_8 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_2 * __pyx_v_stack.strides[0]) ) + __pyx_t_1 * __pyx_v_stack.strides[1]) )));
24760 100024 : __pyx_v_e = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_progress.data + __pyx_t_8 * __pyx_v_progress.strides[0]) )));
24761 :
24762 : /* "scipy/sparse/csgraph/_flow.pyx":614
24763 : * while top > -1:
24764 : * e = progress[stack[top][0]]
24765 : * capacities[e] -= current_flow # <<<<<<<<<<<<<<
24766 : * capacities[rev_edge_ptr[e]] += current_flow
24767 : * flows[e] += current_flow
24768 : */
24769 100024 : __pyx_t_1 = __pyx_v_e;
24770 100024 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_capacities.data + __pyx_t_1 * __pyx_v_capacities.strides[0]) )) -= __pyx_v_current_flow;
24771 :
24772 : /* "scipy/sparse/csgraph/_flow.pyx":615
24773 : * e = progress[stack[top][0]]
24774 : * capacities[e] -= current_flow
24775 : * capacities[rev_edge_ptr[e]] += current_flow # <<<<<<<<<<<<<<
24776 : * flows[e] += current_flow
24777 : * flows[rev_edge_ptr[e]] -= current_flow
24778 : */
24779 100024 : __pyx_t_1 = __pyx_v_e;
24780 100024 : __pyx_t_2 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_rev_edge_ptr.data + __pyx_t_1 * __pyx_v_rev_edge_ptr.strides[0]) )));
24781 100024 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_capacities.data + __pyx_t_2 * __pyx_v_capacities.strides[0]) )) += __pyx_v_current_flow;
24782 :
24783 : /* "scipy/sparse/csgraph/_flow.pyx":616
24784 : * capacities[e] -= current_flow
24785 : * capacities[rev_edge_ptr[e]] += current_flow
24786 : * flows[e] += current_flow # <<<<<<<<<<<<<<
24787 : * flows[rev_edge_ptr[e]] -= current_flow
24788 : * top -= 1
24789 : */
24790 100024 : __pyx_t_1 = __pyx_v_e;
24791 100024 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_flows.data + __pyx_t_1 * __pyx_v_flows.strides[0]) )) += __pyx_v_current_flow;
24792 :
24793 : /* "scipy/sparse/csgraph/_flow.pyx":617
24794 : * capacities[rev_edge_ptr[e]] += current_flow
24795 : * flows[e] += current_flow
24796 : * flows[rev_edge_ptr[e]] -= current_flow # <<<<<<<<<<<<<<
24797 : * top -= 1
24798 : * return True
24799 : */
24800 100024 : __pyx_t_1 = __pyx_v_e;
24801 100024 : __pyx_t_2 = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_rev_edge_ptr.data + __pyx_t_1 * __pyx_v_rev_edge_ptr.strides[0]) )));
24802 100024 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_flows.data + __pyx_t_2 * __pyx_v_flows.strides[0]) )) -= __pyx_v_current_flow;
24803 :
24804 : /* "scipy/sparse/csgraph/_flow.pyx":618
24805 : * flows[e] += current_flow
24806 : * flows[rev_edge_ptr[e]] -= current_flow
24807 : * top -= 1 # <<<<<<<<<<<<<<
24808 : * return True
24809 : * top += 1
24810 : */
24811 100024 : __pyx_v_top = (__pyx_v_top - 1);
24812 : }
24813 :
24814 : /* "scipy/sparse/csgraph/_flow.pyx":619
24815 : * flows[rev_edge_ptr[e]] -= current_flow
24816 : * top -= 1
24817 : * return True # <<<<<<<<<<<<<<
24818 : * top += 1
24819 : * stack[top][0] = dst_vertex
24820 : */
24821 10 : __pyx_r = 1;
24822 10 : goto __pyx_L0;
24823 :
24824 : /* "scipy/sparse/csgraph/_flow.pyx":611
24825 : * levels[dst_vertex] == levels[current] + 1):
24826 : * current_flow = min(flow, capacities[e])
24827 : * if dst_vertex == sink: # <<<<<<<<<<<<<<
24828 : * while top > -1:
24829 : * e = progress[stack[top][0]]
24830 : */
24831 : }
24832 :
24833 : /* "scipy/sparse/csgraph/_flow.pyx":620
24834 : * top -= 1
24835 : * return True
24836 : * top += 1 # <<<<<<<<<<<<<<
24837 : * stack[top][0] = dst_vertex
24838 : * stack[top][1] = current_flow
24839 : */
24840 100023 : __pyx_v_top = (__pyx_v_top + 1);
24841 :
24842 : /* "scipy/sparse/csgraph/_flow.pyx":621
24843 : * return True
24844 : * top += 1
24845 : * stack[top][0] = dst_vertex # <<<<<<<<<<<<<<
24846 : * stack[top][1] = current_flow
24847 : * else:
24848 : */
24849 100023 : __pyx_t_1 = __pyx_v_top;
24850 100023 : __pyx_t_2 = 0;
24851 100023 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_1 * __pyx_v_stack.strides[0]) ) + __pyx_t_2 * __pyx_v_stack.strides[1]) )) = __pyx_v_dst_vertex;
24852 :
24853 : /* "scipy/sparse/csgraph/_flow.pyx":622
24854 : * top += 1
24855 : * stack[top][0] = dst_vertex
24856 : * stack[top][1] = current_flow # <<<<<<<<<<<<<<
24857 : * else:
24858 : * while progress[current] == edge_ptr[current + 1] - 1:
24859 : */
24860 100023 : __pyx_t_2 = __pyx_v_top;
24861 100023 : __pyx_t_1 = 1;
24862 100023 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_2 * __pyx_v_stack.strides[0]) ) + __pyx_t_1 * __pyx_v_stack.strides[1]) )) = __pyx_v_current_flow;
24863 :
24864 : /* "scipy/sparse/csgraph/_flow.pyx":608
24865 : * e = progress[current]
24866 : * dst_vertex = heads[e]
24867 : * if (capacities[e] > 0 and # <<<<<<<<<<<<<<
24868 : * levels[dst_vertex] == levels[current] + 1):
24869 : * current_flow = min(flow, capacities[e])
24870 : */
24871 100023 : goto __pyx_L5;
24872 : }
24873 :
24874 : /* "scipy/sparse/csgraph/_flow.pyx":624
24875 : * stack[top][1] = current_flow
24876 : * else:
24877 : * while progress[current] == edge_ptr[current + 1] - 1: # <<<<<<<<<<<<<<
24878 : * top -= 1
24879 : * if top < 0: return False # Did we pop the source?
24880 : */
24881 : /*else*/ {
24882 100062 : while (1) {
24883 100053 : __pyx_t_1 = __pyx_v_current;
24884 100053 : __pyx_t_2 = (__pyx_v_current + 1);
24885 100053 : __pyx_t_3 = ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_progress.data + __pyx_t_1 * __pyx_v_progress.strides[0]) ))) == ((*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_edge_ptr.data + __pyx_t_2 * __pyx_v_edge_ptr.strides[0]) ))) - 1));
24886 100053 : if (!__pyx_t_3) break;
24887 :
24888 : /* "scipy/sparse/csgraph/_flow.pyx":625
24889 : * else:
24890 : * while progress[current] == edge_ptr[current + 1] - 1:
24891 : * top -= 1 # <<<<<<<<<<<<<<
24892 : * if top < 0: return False # Did we pop the source?
24893 : * current = stack[top][0]
24894 : */
24895 18 : __pyx_v_top = (__pyx_v_top - 1);
24896 :
24897 : /* "scipy/sparse/csgraph/_flow.pyx":626
24898 : * while progress[current] == edge_ptr[current + 1] - 1:
24899 : * top -= 1
24900 : * if top < 0: return False # Did we pop the source? # <<<<<<<<<<<<<<
24901 : * current = stack[top][0]
24902 : * progress[current] += 1
24903 : */
24904 18 : __pyx_t_3 = (__pyx_v_top < 0);
24905 18 : if (__pyx_t_3) {
24906 9 : __pyx_r = 0;
24907 9 : goto __pyx_L0;
24908 : }
24909 :
24910 : /* "scipy/sparse/csgraph/_flow.pyx":627
24911 : * top -= 1
24912 : * if top < 0: return False # Did we pop the source?
24913 : * current = stack[top][0] # <<<<<<<<<<<<<<
24914 : * progress[current] += 1
24915 : *
24916 : */
24917 9 : __pyx_t_2 = __pyx_v_top;
24918 9 : __pyx_t_1 = 0;
24919 9 : __pyx_v_current = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_stack.data + __pyx_t_2 * __pyx_v_stack.strides[0]) ) + __pyx_t_1 * __pyx_v_stack.strides[1]) )));
24920 : }
24921 :
24922 : /* "scipy/sparse/csgraph/_flow.pyx":628
24923 : * if top < 0: return False # Did we pop the source?
24924 : * current = stack[top][0]
24925 : * progress[current] += 1 # <<<<<<<<<<<<<<
24926 : *
24927 : * cdef ITYPE_t[:] _dinic(
24928 : */
24929 100035 : __pyx_t_1 = __pyx_v_current;
24930 100035 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_progress.data + __pyx_t_1 * __pyx_v_progress.strides[0]) )) += 1;
24931 : }
24932 : __pyx_L5:;
24933 : }
24934 :
24935 : /* "scipy/sparse/csgraph/_flow.pyx":551
24936 : * return 0
24937 : *
24938 : * cdef bint _augment_paths( # <<<<<<<<<<<<<<
24939 : * const ITYPE_t[:] edge_ptr, # IN
24940 : * const ITYPE_t source, # IN
24941 : */
24942 :
24943 : /* function exit code */
24944 : __pyx_r = 0;
24945 19 : __pyx_L0:;
24946 19 : return __pyx_r;
24947 : }
24948 :
24949 : /* "scipy/sparse/csgraph/_flow.pyx":630
24950 : * progress[current] += 1
24951 : *
24952 : * cdef ITYPE_t[:] _dinic( # <<<<<<<<<<<<<<
24953 : * const ITYPE_t[:] edge_ptr,
24954 : * const ITYPE_t[:] heads,
24955 : */
24956 :
24957 8 : static __Pyx_memviewslice __pyx_f_5scipy_6sparse_7csgraph_5_flow__dinic(__Pyx_memviewslice __pyx_v_edge_ptr, __Pyx_memviewslice __pyx_v_heads, __Pyx_memviewslice __pyx_v_capacities, __Pyx_memviewslice __pyx_v_rev_edge_ptr, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_source, __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const __pyx_v_sink) {
24958 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_n_verts;
24959 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_n_edges;
24960 8 : __Pyx_memviewslice __pyx_v_levels = { 0, 0, { 0 }, { 0 }, { 0 } };
24961 8 : __Pyx_memviewslice __pyx_v_progress = { 0, 0, { 0 }, { 0 }, { 0 } };
24962 8 : __Pyx_memviewslice __pyx_v_q = { 0, 0, { 0 }, { 0 }, { 0 } };
24963 8 : __Pyx_memviewslice __pyx_v_stack = { 0, 0, { 0 }, { 0 }, { 0 } };
24964 8 : __Pyx_memviewslice __pyx_v_flows = { 0, 0, { 0 }, { 0 }, { 0 } };
24965 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_v_i;
24966 8 : __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
24967 : __Pyx_RefNannyDeclarations
24968 8 : PyObject *__pyx_t_1 = NULL;
24969 8 : PyObject *__pyx_t_2 = NULL;
24970 8 : PyObject *__pyx_t_3 = NULL;
24971 8 : PyObject *__pyx_t_4 = NULL;
24972 8 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
24973 8 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
24974 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_7;
24975 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_8;
24976 8 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t __pyx_t_9;
24977 8 : Py_ssize_t __pyx_t_10;
24978 8 : int __pyx_t_11;
24979 8 : Py_ssize_t __pyx_t_12;
24980 8 : int __pyx_lineno = 0;
24981 8 : const char *__pyx_filename = NULL;
24982 8 : int __pyx_clineno = 0;
24983 8 : __Pyx_RefNannySetupContext("_dinic", 1);
24984 :
24985 : /* "scipy/sparse/csgraph/_flow.pyx":665
24986 : *
24987 : * """
24988 : * cdef ITYPE_t n_verts = edge_ptr.shape[0] - 1 # <<<<<<<<<<<<<<
24989 : * cdef ITYPE_t n_edges = capacities.shape[0]
24990 : *
24991 : */
24992 8 : __pyx_v_n_verts = ((__pyx_v_edge_ptr.shape[0]) - 1);
24993 :
24994 : /* "scipy/sparse/csgraph/_flow.pyx":666
24995 : * """
24996 : * cdef ITYPE_t n_verts = edge_ptr.shape[0] - 1
24997 : * cdef ITYPE_t n_edges = capacities.shape[0] # <<<<<<<<<<<<<<
24998 : *
24999 : * cdef ITYPE_t[:] levels = np.empty(n_verts, dtype=ITYPE)
25000 : */
25001 8 : __pyx_v_n_edges = (__pyx_v_capacities.shape[0]);
25002 :
25003 : /* "scipy/sparse/csgraph/_flow.pyx":668
25004 : * cdef ITYPE_t n_edges = capacities.shape[0]
25005 : *
25006 : * cdef ITYPE_t[:] levels = np.empty(n_verts, dtype=ITYPE) # <<<<<<<<<<<<<<
25007 : * cdef ITYPE_t[:] progress = np.empty(n_verts, dtype=ITYPE)
25008 : * cdef ITYPE_t[:] q = np.empty(n_verts, dtype=ITYPE)
25009 : */
25010 8 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
25011 8 : __Pyx_GOTREF(__pyx_t_1);
25012 8 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
25013 8 : __Pyx_GOTREF(__pyx_t_2);
25014 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25015 8 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_verts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
25016 8 : __Pyx_GOTREF(__pyx_t_1);
25017 8 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
25018 8 : __Pyx_GOTREF(__pyx_t_3);
25019 8 : __Pyx_GIVEREF(__pyx_t_1);
25020 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error);
25021 8 : __pyx_t_1 = 0;
25022 8 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
25023 8 : __Pyx_GOTREF(__pyx_t_1);
25024 8 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error)
25025 8 : __Pyx_GOTREF(__pyx_t_4);
25026 8 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
25027 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25028 8 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error)
25029 8 : __Pyx_GOTREF(__pyx_t_4);
25030 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25031 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25032 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25033 8 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 668, __pyx_L1_error)
25034 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25035 8 : __pyx_v_levels = __pyx_t_5;
25036 8 : __pyx_t_5.memview = NULL;
25037 8 : __pyx_t_5.data = NULL;
25038 :
25039 : /* "scipy/sparse/csgraph/_flow.pyx":669
25040 : *
25041 : * cdef ITYPE_t[:] levels = np.empty(n_verts, dtype=ITYPE)
25042 : * cdef ITYPE_t[:] progress = np.empty(n_verts, dtype=ITYPE) # <<<<<<<<<<<<<<
25043 : * cdef ITYPE_t[:] q = np.empty(n_verts, dtype=ITYPE)
25044 : * cdef ITYPE_t[:, :] stack = np.empty((n_verts, 2), dtype=ITYPE)
25045 : */
25046 8 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
25047 8 : __Pyx_GOTREF(__pyx_t_4);
25048 8 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
25049 8 : __Pyx_GOTREF(__pyx_t_1);
25050 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25051 8 : __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_verts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
25052 8 : __Pyx_GOTREF(__pyx_t_4);
25053 8 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error)
25054 8 : __Pyx_GOTREF(__pyx_t_3);
25055 8 : __Pyx_GIVEREF(__pyx_t_4);
25056 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error);
25057 8 : __pyx_t_4 = 0;
25058 8 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
25059 8 : __Pyx_GOTREF(__pyx_t_4);
25060 8 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
25061 8 : __Pyx_GOTREF(__pyx_t_2);
25062 8 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
25063 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25064 8 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
25065 8 : __Pyx_GOTREF(__pyx_t_2);
25066 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25067 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25068 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25069 8 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 669, __pyx_L1_error)
25070 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25071 8 : __pyx_v_progress = __pyx_t_5;
25072 8 : __pyx_t_5.memview = NULL;
25073 8 : __pyx_t_5.data = NULL;
25074 :
25075 : /* "scipy/sparse/csgraph/_flow.pyx":670
25076 : * cdef ITYPE_t[:] levels = np.empty(n_verts, dtype=ITYPE)
25077 : * cdef ITYPE_t[:] progress = np.empty(n_verts, dtype=ITYPE)
25078 : * cdef ITYPE_t[:] q = np.empty(n_verts, dtype=ITYPE) # <<<<<<<<<<<<<<
25079 : * cdef ITYPE_t[:, :] stack = np.empty((n_verts, 2), dtype=ITYPE)
25080 : * cdef ITYPE_t[:] flows = np.zeros(n_edges, dtype=ITYPE)
25081 : */
25082 8 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
25083 8 : __Pyx_GOTREF(__pyx_t_2);
25084 8 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error)
25085 8 : __Pyx_GOTREF(__pyx_t_4);
25086 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25087 8 : __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_verts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
25088 8 : __Pyx_GOTREF(__pyx_t_2);
25089 8 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error)
25090 8 : __Pyx_GOTREF(__pyx_t_3);
25091 8 : __Pyx_GIVEREF(__pyx_t_2);
25092 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error);
25093 8 : __pyx_t_2 = 0;
25094 8 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
25095 8 : __Pyx_GOTREF(__pyx_t_2);
25096 8 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
25097 8 : __Pyx_GOTREF(__pyx_t_1);
25098 8 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 670, __pyx_L1_error)
25099 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25100 8 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
25101 8 : __Pyx_GOTREF(__pyx_t_1);
25102 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25103 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25104 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25105 8 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 670, __pyx_L1_error)
25106 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25107 8 : __pyx_v_q = __pyx_t_5;
25108 8 : __pyx_t_5.memview = NULL;
25109 8 : __pyx_t_5.data = NULL;
25110 :
25111 : /* "scipy/sparse/csgraph/_flow.pyx":671
25112 : * cdef ITYPE_t[:] progress = np.empty(n_verts, dtype=ITYPE)
25113 : * cdef ITYPE_t[:] q = np.empty(n_verts, dtype=ITYPE)
25114 : * cdef ITYPE_t[:, :] stack = np.empty((n_verts, 2), dtype=ITYPE) # <<<<<<<<<<<<<<
25115 : * cdef ITYPE_t[:] flows = np.zeros(n_edges, dtype=ITYPE)
25116 : * while True:
25117 : */
25118 8 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
25119 8 : __Pyx_GOTREF(__pyx_t_1);
25120 8 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
25121 8 : __Pyx_GOTREF(__pyx_t_2);
25122 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25123 8 : __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_verts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
25124 8 : __Pyx_GOTREF(__pyx_t_1);
25125 8 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
25126 8 : __Pyx_GOTREF(__pyx_t_3);
25127 8 : __Pyx_GIVEREF(__pyx_t_1);
25128 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error);
25129 8 : __Pyx_INCREF(__pyx_int_2);
25130 8 : __Pyx_GIVEREF(__pyx_int_2);
25131 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2)) __PYX_ERR(0, 671, __pyx_L1_error);
25132 8 : __pyx_t_1 = 0;
25133 8 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
25134 8 : __Pyx_GOTREF(__pyx_t_1);
25135 8 : __Pyx_GIVEREF(__pyx_t_3);
25136 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error);
25137 8 : __pyx_t_3 = 0;
25138 8 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
25139 8 : __Pyx_GOTREF(__pyx_t_3);
25140 8 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
25141 8 : __Pyx_GOTREF(__pyx_t_4);
25142 8 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 671, __pyx_L1_error)
25143 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25144 8 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
25145 8 : __Pyx_GOTREF(__pyx_t_4);
25146 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25147 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25148 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25149 8 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 671, __pyx_L1_error)
25150 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25151 8 : __pyx_v_stack = __pyx_t_6;
25152 8 : __pyx_t_6.memview = NULL;
25153 8 : __pyx_t_6.data = NULL;
25154 :
25155 : /* "scipy/sparse/csgraph/_flow.pyx":672
25156 : * cdef ITYPE_t[:] q = np.empty(n_verts, dtype=ITYPE)
25157 : * cdef ITYPE_t[:, :] stack = np.empty((n_verts, 2), dtype=ITYPE)
25158 : * cdef ITYPE_t[:] flows = np.zeros(n_edges, dtype=ITYPE) # <<<<<<<<<<<<<<
25159 : * while True:
25160 : * for i in range(n_verts):
25161 : */
25162 8 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error)
25163 8 : __Pyx_GOTREF(__pyx_t_4);
25164 8 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
25165 8 : __Pyx_GOTREF(__pyx_t_3);
25166 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25167 8 : __pyx_t_4 = __Pyx_PyInt_From_npy_int32(__pyx_v_n_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error)
25168 8 : __Pyx_GOTREF(__pyx_t_4);
25169 8 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
25170 8 : __Pyx_GOTREF(__pyx_t_1);
25171 8 : __Pyx_GIVEREF(__pyx_t_4);
25172 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error);
25173 8 : __pyx_t_4 = 0;
25174 8 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error)
25175 8 : __Pyx_GOTREF(__pyx_t_4);
25176 8 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ITYPE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
25177 8 : __Pyx_GOTREF(__pyx_t_2);
25178 8 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 672, __pyx_L1_error)
25179 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25180 8 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
25181 8 : __Pyx_GOTREF(__pyx_t_2);
25182 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25183 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25184 8 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25185 8 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 672, __pyx_L1_error)
25186 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25187 8 : __pyx_v_flows = __pyx_t_5;
25188 8 : __pyx_t_5.memview = NULL;
25189 8 : __pyx_t_5.data = NULL;
25190 :
25191 : /* "scipy/sparse/csgraph/_flow.pyx":673
25192 : * cdef ITYPE_t[:, :] stack = np.empty((n_verts, 2), dtype=ITYPE)
25193 : * cdef ITYPE_t[:] flows = np.zeros(n_edges, dtype=ITYPE)
25194 : * while True: # <<<<<<<<<<<<<<
25195 : * for i in range(n_verts):
25196 : * levels[i] = -1
25197 : */
25198 17 : while (1) {
25199 :
25200 : /* "scipy/sparse/csgraph/_flow.pyx":674
25201 : * cdef ITYPE_t[:] flows = np.zeros(n_edges, dtype=ITYPE)
25202 : * while True:
25203 : * for i in range(n_verts): # <<<<<<<<<<<<<<
25204 : * levels[i] = -1
25205 : * if not _build_level_graph(edge_ptr, source, sink,
25206 : */
25207 17 : __pyx_t_7 = __pyx_v_n_verts;
25208 17 : __pyx_t_8 = __pyx_t_7;
25209 200081 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
25210 200064 : __pyx_v_i = __pyx_t_9;
25211 :
25212 : /* "scipy/sparse/csgraph/_flow.pyx":675
25213 : * while True:
25214 : * for i in range(n_verts):
25215 : * levels[i] = -1 # <<<<<<<<<<<<<<
25216 : * if not _build_level_graph(edge_ptr, source, sink,
25217 : * capacities, heads, levels, q):
25218 : */
25219 200064 : __pyx_t_10 = __pyx_v_i;
25220 200064 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_10 * __pyx_v_levels.strides[0]) )) = -1;
25221 : }
25222 :
25223 : /* "scipy/sparse/csgraph/_flow.pyx":676
25224 : * for i in range(n_verts):
25225 : * levels[i] = -1
25226 : * if not _build_level_graph(edge_ptr, source, sink, # <<<<<<<<<<<<<<
25227 : * capacities, heads, levels, q):
25228 : * break
25229 : */
25230 17 : __pyx_t_11 = (!__pyx_f_5scipy_6sparse_7csgraph_5_flow__build_level_graph(__pyx_v_edge_ptr, __pyx_v_source, __pyx_v_sink, __pyx_v_capacities, __pyx_v_heads, __pyx_v_levels, __pyx_v_q));
25231 17 : if (__pyx_t_11) {
25232 :
25233 : /* "scipy/sparse/csgraph/_flow.pyx":678
25234 : * if not _build_level_graph(edge_ptr, source, sink,
25235 : * capacities, heads, levels, q):
25236 : * break # <<<<<<<<<<<<<<
25237 : * for i in range(n_verts):
25238 : * progress[i] = edge_ptr[i]
25239 : */
25240 8 : goto __pyx_L4_break;
25241 :
25242 : /* "scipy/sparse/csgraph/_flow.pyx":676
25243 : * for i in range(n_verts):
25244 : * levels[i] = -1
25245 : * if not _build_level_graph(edge_ptr, source, sink, # <<<<<<<<<<<<<<
25246 : * capacities, heads, levels, q):
25247 : * break
25248 : */
25249 : }
25250 :
25251 : /* "scipy/sparse/csgraph/_flow.pyx":679
25252 : * capacities, heads, levels, q):
25253 : * break
25254 : * for i in range(n_verts): # <<<<<<<<<<<<<<
25255 : * progress[i] = edge_ptr[i]
25256 : * while _augment_paths(edge_ptr, source, sink,
25257 : */
25258 100046 : __pyx_t_7 = __pyx_v_n_verts;
25259 100046 : __pyx_t_8 = __pyx_t_7;
25260 100046 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
25261 100037 : __pyx_v_i = __pyx_t_9;
25262 :
25263 : /* "scipy/sparse/csgraph/_flow.pyx":680
25264 : * break
25265 : * for i in range(n_verts):
25266 : * progress[i] = edge_ptr[i] # <<<<<<<<<<<<<<
25267 : * while _augment_paths(edge_ptr, source, sink,
25268 : * levels, heads, rev_edge_ptr,
25269 : */
25270 100037 : __pyx_t_10 = __pyx_v_i;
25271 100037 : __pyx_t_12 = __pyx_v_i;
25272 100037 : *((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) ( /* dim=0 */ (__pyx_v_progress.data + __pyx_t_12 * __pyx_v_progress.strides[0]) )) = (*((__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t const *) ( /* dim=0 */ (__pyx_v_edge_ptr.data + __pyx_t_10 * __pyx_v_edge_ptr.strides[0]) )));
25273 : }
25274 :
25275 : /* "scipy/sparse/csgraph/_flow.pyx":681
25276 : * for i in range(n_verts):
25277 : * progress[i] = edge_ptr[i]
25278 : * while _augment_paths(edge_ptr, source, sink, # <<<<<<<<<<<<<<
25279 : * levels, heads, rev_edge_ptr,
25280 : * capacities, progress, flows, stack):
25281 : */
25282 19 : while (1) {
25283 :
25284 : /* "scipy/sparse/csgraph/_flow.pyx":683
25285 : * while _augment_paths(edge_ptr, source, sink,
25286 : * levels, heads, rev_edge_ptr,
25287 : * capacities, progress, flows, stack): # <<<<<<<<<<<<<<
25288 : * pass
25289 : * return flows
25290 : */
25291 19 : __pyx_t_11 = __pyx_f_5scipy_6sparse_7csgraph_5_flow__augment_paths(__pyx_v_edge_ptr, __pyx_v_source, __pyx_v_sink, __pyx_v_levels, __pyx_v_heads, __pyx_v_rev_edge_ptr, __pyx_v_capacities, __pyx_v_progress, __pyx_v_flows, __pyx_v_stack);
25292 19 : if (!__pyx_t_11) break;
25293 : }
25294 : }
25295 8 : __pyx_L4_break:;
25296 :
25297 : /* "scipy/sparse/csgraph/_flow.pyx":685
25298 : * capacities, progress, flows, stack):
25299 : * pass
25300 : * return flows # <<<<<<<<<<<<<<
25301 : */
25302 8 : __PYX_INC_MEMVIEW(&__pyx_v_flows, 1);
25303 8 : __pyx_r = __pyx_v_flows;
25304 8 : goto __pyx_L0;
25305 :
25306 : /* "scipy/sparse/csgraph/_flow.pyx":630
25307 : * progress[current] += 1
25308 : *
25309 : * cdef ITYPE_t[:] _dinic( # <<<<<<<<<<<<<<
25310 : * const ITYPE_t[:] edge_ptr,
25311 : * const ITYPE_t[:] heads,
25312 : */
25313 :
25314 : /* function exit code */
25315 0 : __pyx_L1_error:;
25316 0 : __Pyx_XDECREF(__pyx_t_1);
25317 0 : __Pyx_XDECREF(__pyx_t_2);
25318 0 : __Pyx_XDECREF(__pyx_t_3);
25319 0 : __Pyx_XDECREF(__pyx_t_4);
25320 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
25321 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
25322 0 : __pyx_r.data = NULL;
25323 0 : __pyx_r.memview = NULL;
25324 0 : __Pyx_AddTraceback("scipy.sparse.csgraph._flow._dinic", __pyx_clineno, __pyx_lineno, __pyx_filename);
25325 0 : goto __pyx_L2;
25326 8 : __pyx_L0:;
25327 8 : if (unlikely(!__pyx_r.memview)) {
25328 0 : PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
25329 : }
25330 8 : __pyx_L2:;
25331 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_levels, 1);
25332 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_progress, 1);
25333 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_q, 1);
25334 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_stack, 1);
25335 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_flows, 1);
25336 8 : __Pyx_RefNannyFinishContext();
25337 8 : return __pyx_r;
25338 : }
25339 : static struct __pyx_vtabstruct_array __pyx_vtable_array;
25340 :
25341 0 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25342 0 : struct __pyx_array_obj *p;
25343 0 : PyObject *o;
25344 : #if CYTHON_COMPILING_IN_LIMITED_API
25345 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25346 : o = alloc_func(t, 0);
25347 : #else
25348 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25349 0 : o = (*t->tp_alloc)(t, 0);
25350 : } else {
25351 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25352 : }
25353 0 : if (unlikely(!o)) return 0;
25354 : #endif
25355 0 : p = ((struct __pyx_array_obj *)o);
25356 0 : p->__pyx_vtab = __pyx_vtabptr_array;
25357 0 : p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25358 0 : p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25359 0 : if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
25360 : return o;
25361 0 : bad:
25362 0 : Py_DECREF(o); o = 0;
25363 : return NULL;
25364 : }
25365 :
25366 0 : static void __pyx_tp_dealloc_array(PyObject *o) {
25367 0 : struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25368 : #if CYTHON_USE_TP_FINALIZE
25369 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
25370 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
25371 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25372 : }
25373 : }
25374 : #endif
25375 : {
25376 0 : PyObject *etype, *eval, *etb;
25377 0 : PyErr_Fetch(&etype, &eval, &etb);
25378 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25379 0 : __pyx_array___dealloc__(o);
25380 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25381 0 : PyErr_Restore(etype, eval, etb);
25382 : }
25383 0 : Py_CLEAR(p->mode);
25384 0 : Py_CLEAR(p->_format);
25385 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25386 0 : (*Py_TYPE(o)->tp_free)(o);
25387 : #else
25388 : {
25389 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25390 : if (tp_free) tp_free(o);
25391 : }
25392 : #endif
25393 : }
25394 0 : static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25395 0 : PyObject *r;
25396 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25397 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25398 0 : Py_DECREF(x);
25399 : return r;
25400 : }
25401 :
25402 0 : static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25403 0 : if (v) {
25404 0 : return __pyx_array___setitem__(o, i, v);
25405 : }
25406 : else {
25407 0 : __Pyx_TypeName o_type_name;
25408 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
25409 0 : PyErr_Format(PyExc_NotImplementedError,
25410 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
25411 0 : __Pyx_DECREF_TypeName(o_type_name);
25412 0 : return -1;
25413 : }
25414 : }
25415 :
25416 0 : static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25417 0 : PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25418 0 : if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25419 0 : PyErr_Clear();
25420 0 : v = __pyx_array___getattr__(o, n);
25421 : }
25422 0 : return v;
25423 : }
25424 :
25425 0 : static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25426 0 : return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25427 : }
25428 :
25429 : static PyMethodDef __pyx_methods_array[] = {
25430 : {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25431 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25432 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25433 : {0, 0, 0, 0}
25434 : };
25435 :
25436 : static struct PyGetSetDef __pyx_getsets_array[] = {
25437 : {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
25438 : {0, 0, 0, 0, 0}
25439 : };
25440 : #if CYTHON_USE_TYPE_SPECS
25441 : #if !CYTHON_COMPILING_IN_LIMITED_API
25442 :
25443 : static PyBufferProcs __pyx_tp_as_buffer_array = {
25444 : #if PY_MAJOR_VERSION < 3
25445 : 0, /*bf_getreadbuffer*/
25446 : #endif
25447 : #if PY_MAJOR_VERSION < 3
25448 : 0, /*bf_getwritebuffer*/
25449 : #endif
25450 : #if PY_MAJOR_VERSION < 3
25451 : 0, /*bf_getsegcount*/
25452 : #endif
25453 : #if PY_MAJOR_VERSION < 3
25454 : 0, /*bf_getcharbuffer*/
25455 : #endif
25456 : __pyx_array_getbuffer, /*bf_getbuffer*/
25457 : 0, /*bf_releasebuffer*/
25458 : };
25459 : #endif
25460 : static PyType_Slot __pyx_type___pyx_array_slots[] = {
25461 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
25462 : {Py_sq_length, (void *)__pyx_array___len__},
25463 : {Py_sq_item, (void *)__pyx_sq_item_array},
25464 : {Py_mp_length, (void *)__pyx_array___len__},
25465 : {Py_mp_subscript, (void *)__pyx_array___getitem__},
25466 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
25467 : {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
25468 : #if defined(Py_bf_getbuffer)
25469 : {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
25470 : #endif
25471 : {Py_tp_methods, (void *)__pyx_methods_array},
25472 : {Py_tp_getset, (void *)__pyx_getsets_array},
25473 : {Py_tp_new, (void *)__pyx_tp_new_array},
25474 : {0, 0},
25475 : };
25476 : static PyType_Spec __pyx_type___pyx_array_spec = {
25477 : "scipy.sparse.csgraph._flow.array",
25478 : sizeof(struct __pyx_array_obj),
25479 : 0,
25480 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
25481 : __pyx_type___pyx_array_slots,
25482 : };
25483 : #else
25484 :
25485 : static PySequenceMethods __pyx_tp_as_sequence_array = {
25486 : __pyx_array___len__, /*sq_length*/
25487 : 0, /*sq_concat*/
25488 : 0, /*sq_repeat*/
25489 : __pyx_sq_item_array, /*sq_item*/
25490 : 0, /*sq_slice*/
25491 : 0, /*sq_ass_item*/
25492 : 0, /*sq_ass_slice*/
25493 : 0, /*sq_contains*/
25494 : 0, /*sq_inplace_concat*/
25495 : 0, /*sq_inplace_repeat*/
25496 : };
25497 :
25498 : static PyMappingMethods __pyx_tp_as_mapping_array = {
25499 : __pyx_array___len__, /*mp_length*/
25500 : __pyx_array___getitem__, /*mp_subscript*/
25501 : __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
25502 : };
25503 :
25504 : static PyBufferProcs __pyx_tp_as_buffer_array = {
25505 : #if PY_MAJOR_VERSION < 3
25506 : 0, /*bf_getreadbuffer*/
25507 : #endif
25508 : #if PY_MAJOR_VERSION < 3
25509 : 0, /*bf_getwritebuffer*/
25510 : #endif
25511 : #if PY_MAJOR_VERSION < 3
25512 : 0, /*bf_getsegcount*/
25513 : #endif
25514 : #if PY_MAJOR_VERSION < 3
25515 : 0, /*bf_getcharbuffer*/
25516 : #endif
25517 : __pyx_array_getbuffer, /*bf_getbuffer*/
25518 : 0, /*bf_releasebuffer*/
25519 : };
25520 :
25521 : static PyTypeObject __pyx_type___pyx_array = {
25522 : PyVarObject_HEAD_INIT(0, 0)
25523 : "scipy.sparse.csgraph._flow.""array", /*tp_name*/
25524 : sizeof(struct __pyx_array_obj), /*tp_basicsize*/
25525 : 0, /*tp_itemsize*/
25526 : __pyx_tp_dealloc_array, /*tp_dealloc*/
25527 : #if PY_VERSION_HEX < 0x030800b4
25528 : 0, /*tp_print*/
25529 : #endif
25530 : #if PY_VERSION_HEX >= 0x030800b4
25531 : 0, /*tp_vectorcall_offset*/
25532 : #endif
25533 : 0, /*tp_getattr*/
25534 : 0, /*tp_setattr*/
25535 : #if PY_MAJOR_VERSION < 3
25536 : 0, /*tp_compare*/
25537 : #endif
25538 : #if PY_MAJOR_VERSION >= 3
25539 : 0, /*tp_as_async*/
25540 : #endif
25541 : 0, /*tp_repr*/
25542 : 0, /*tp_as_number*/
25543 : &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
25544 : &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
25545 : 0, /*tp_hash*/
25546 : 0, /*tp_call*/
25547 : 0, /*tp_str*/
25548 : __pyx_tp_getattro_array, /*tp_getattro*/
25549 : 0, /*tp_setattro*/
25550 : &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
25551 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
25552 : 0, /*tp_doc*/
25553 : 0, /*tp_traverse*/
25554 : 0, /*tp_clear*/
25555 : 0, /*tp_richcompare*/
25556 : 0, /*tp_weaklistoffset*/
25557 : 0, /*tp_iter*/
25558 : 0, /*tp_iternext*/
25559 : __pyx_methods_array, /*tp_methods*/
25560 : 0, /*tp_members*/
25561 : __pyx_getsets_array, /*tp_getset*/
25562 : 0, /*tp_base*/
25563 : 0, /*tp_dict*/
25564 : 0, /*tp_descr_get*/
25565 : 0, /*tp_descr_set*/
25566 : #if !CYTHON_USE_TYPE_SPECS
25567 : 0, /*tp_dictoffset*/
25568 : #endif
25569 : 0, /*tp_init*/
25570 : 0, /*tp_alloc*/
25571 : __pyx_tp_new_array, /*tp_new*/
25572 : 0, /*tp_free*/
25573 : 0, /*tp_is_gc*/
25574 : 0, /*tp_bases*/
25575 : 0, /*tp_mro*/
25576 : 0, /*tp_cache*/
25577 : 0, /*tp_subclasses*/
25578 : 0, /*tp_weaklist*/
25579 : 0, /*tp_del*/
25580 : 0, /*tp_version_tag*/
25581 : #if PY_VERSION_HEX >= 0x030400a1
25582 : #if CYTHON_USE_TP_FINALIZE
25583 : 0, /*tp_finalize*/
25584 : #else
25585 : NULL, /*tp_finalize*/
25586 : #endif
25587 : #endif
25588 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25589 : 0, /*tp_vectorcall*/
25590 : #endif
25591 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25592 : 0, /*tp_print*/
25593 : #endif
25594 : #if PY_VERSION_HEX >= 0x030C0000
25595 : 0, /*tp_watched*/
25596 : #endif
25597 : #if PY_VERSION_HEX >= 0x030d00A4
25598 : 0, /*tp_versions_used*/
25599 : #endif
25600 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25601 : 0, /*tp_pypy_flags*/
25602 : #endif
25603 : };
25604 : #endif
25605 :
25606 15 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25607 15 : struct __pyx_MemviewEnum_obj *p;
25608 15 : PyObject *o;
25609 : #if CYTHON_COMPILING_IN_LIMITED_API
25610 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25611 : o = alloc_func(t, 0);
25612 : #else
25613 15 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25614 15 : o = (*t->tp_alloc)(t, 0);
25615 : } else {
25616 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25617 : }
25618 15 : if (unlikely(!o)) return 0;
25619 : #endif
25620 15 : p = ((struct __pyx_MemviewEnum_obj *)o);
25621 15 : p->name = Py_None; Py_INCREF(Py_None);
25622 : return o;
25623 : }
25624 :
25625 0 : static void __pyx_tp_dealloc_Enum(PyObject *o) {
25626 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25627 : #if CYTHON_USE_TP_FINALIZE
25628 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25629 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
25630 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25631 : }
25632 : }
25633 : #endif
25634 0 : PyObject_GC_UnTrack(o);
25635 0 : Py_CLEAR(p->name);
25636 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25637 0 : (*Py_TYPE(o)->tp_free)(o);
25638 : #else
25639 : {
25640 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25641 : if (tp_free) tp_free(o);
25642 : }
25643 : #endif
25644 : }
25645 :
25646 805 : static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
25647 805 : int e;
25648 805 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25649 805 : if (p->name) {
25650 805 : e = (*v)(p->name, a); if (e) return e;
25651 : }
25652 : return 0;
25653 : }
25654 :
25655 0 : static int __pyx_tp_clear_Enum(PyObject *o) {
25656 0 : PyObject* tmp;
25657 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25658 0 : tmp = ((PyObject*)p->name);
25659 0 : p->name = Py_None; Py_INCREF(Py_None);
25660 0 : Py_XDECREF(tmp);
25661 0 : return 0;
25662 : }
25663 :
25664 0 : static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
25665 0 : return __pyx_MemviewEnum___repr__(self);
25666 : }
25667 :
25668 : static PyMethodDef __pyx_methods_Enum[] = {
25669 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
25670 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25671 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25672 : {0, 0, 0, 0}
25673 : };
25674 : #if CYTHON_USE_TYPE_SPECS
25675 : static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
25676 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
25677 : {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
25678 : {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
25679 : {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
25680 : {Py_tp_methods, (void *)__pyx_methods_Enum},
25681 : {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
25682 : {Py_tp_new, (void *)__pyx_tp_new_Enum},
25683 : {0, 0},
25684 : };
25685 : static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
25686 : "scipy.sparse.csgraph._flow.Enum",
25687 : sizeof(struct __pyx_MemviewEnum_obj),
25688 : 0,
25689 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
25690 : __pyx_type___pyx_MemviewEnum_slots,
25691 : };
25692 : #else
25693 :
25694 : static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25695 : PyVarObject_HEAD_INIT(0, 0)
25696 : "scipy.sparse.csgraph._flow.""Enum", /*tp_name*/
25697 : sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
25698 : 0, /*tp_itemsize*/
25699 : __pyx_tp_dealloc_Enum, /*tp_dealloc*/
25700 : #if PY_VERSION_HEX < 0x030800b4
25701 : 0, /*tp_print*/
25702 : #endif
25703 : #if PY_VERSION_HEX >= 0x030800b4
25704 : 0, /*tp_vectorcall_offset*/
25705 : #endif
25706 : 0, /*tp_getattr*/
25707 : 0, /*tp_setattr*/
25708 : #if PY_MAJOR_VERSION < 3
25709 : 0, /*tp_compare*/
25710 : #endif
25711 : #if PY_MAJOR_VERSION >= 3
25712 : 0, /*tp_as_async*/
25713 : #endif
25714 : __pyx_MemviewEnum___repr__, /*tp_repr*/
25715 : 0, /*tp_as_number*/
25716 : 0, /*tp_as_sequence*/
25717 : 0, /*tp_as_mapping*/
25718 : 0, /*tp_hash*/
25719 : 0, /*tp_call*/
25720 : 0, /*tp_str*/
25721 : 0, /*tp_getattro*/
25722 : 0, /*tp_setattro*/
25723 : 0, /*tp_as_buffer*/
25724 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25725 : 0, /*tp_doc*/
25726 : __pyx_tp_traverse_Enum, /*tp_traverse*/
25727 : __pyx_tp_clear_Enum, /*tp_clear*/
25728 : 0, /*tp_richcompare*/
25729 : 0, /*tp_weaklistoffset*/
25730 : 0, /*tp_iter*/
25731 : 0, /*tp_iternext*/
25732 : __pyx_methods_Enum, /*tp_methods*/
25733 : 0, /*tp_members*/
25734 : 0, /*tp_getset*/
25735 : 0, /*tp_base*/
25736 : 0, /*tp_dict*/
25737 : 0, /*tp_descr_get*/
25738 : 0, /*tp_descr_set*/
25739 : #if !CYTHON_USE_TYPE_SPECS
25740 : 0, /*tp_dictoffset*/
25741 : #endif
25742 : __pyx_MemviewEnum___init__, /*tp_init*/
25743 : 0, /*tp_alloc*/
25744 : __pyx_tp_new_Enum, /*tp_new*/
25745 : 0, /*tp_free*/
25746 : 0, /*tp_is_gc*/
25747 : 0, /*tp_bases*/
25748 : 0, /*tp_mro*/
25749 : 0, /*tp_cache*/
25750 : 0, /*tp_subclasses*/
25751 : 0, /*tp_weaklist*/
25752 : 0, /*tp_del*/
25753 : 0, /*tp_version_tag*/
25754 : #if PY_VERSION_HEX >= 0x030400a1
25755 : #if CYTHON_USE_TP_FINALIZE
25756 : 0, /*tp_finalize*/
25757 : #else
25758 : NULL, /*tp_finalize*/
25759 : #endif
25760 : #endif
25761 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25762 : 0, /*tp_vectorcall*/
25763 : #endif
25764 : #if __PYX_NEED_TP_PRINT_SLOT == 1
25765 : 0, /*tp_print*/
25766 : #endif
25767 : #if PY_VERSION_HEX >= 0x030C0000
25768 : 0, /*tp_watched*/
25769 : #endif
25770 : #if PY_VERSION_HEX >= 0x030d00A4
25771 : 0, /*tp_versions_used*/
25772 : #endif
25773 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25774 : 0, /*tp_pypy_flags*/
25775 : #endif
25776 : };
25777 : #endif
25778 : static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
25779 :
25780 343 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
25781 343 : struct __pyx_memoryview_obj *p;
25782 343 : PyObject *o;
25783 : #if CYTHON_COMPILING_IN_LIMITED_API
25784 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
25785 : o = alloc_func(t, 0);
25786 : #else
25787 343 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
25788 343 : o = (*t->tp_alloc)(t, 0);
25789 : } else {
25790 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25791 : }
25792 343 : if (unlikely(!o)) return 0;
25793 : #endif
25794 343 : p = ((struct __pyx_memoryview_obj *)o);
25795 343 : p->__pyx_vtab = __pyx_vtabptr_memoryview;
25796 343 : p->obj = Py_None; Py_INCREF(Py_None);
25797 343 : p->_size = Py_None; Py_INCREF(Py_None);
25798 343 : p->_array_interface = Py_None; Py_INCREF(Py_None);
25799 343 : p->view.obj = NULL;
25800 343 : if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
25801 : return o;
25802 0 : bad:
25803 0 : Py_DECREF(o); o = 0;
25804 : return NULL;
25805 : }
25806 :
25807 343 : static void __pyx_tp_dealloc_memoryview(PyObject *o) {
25808 343 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25809 : #if CYTHON_USE_TP_FINALIZE
25810 343 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
25811 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
25812 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
25813 : }
25814 : }
25815 : #endif
25816 343 : PyObject_GC_UnTrack(o);
25817 : {
25818 343 : PyObject *etype, *eval, *etb;
25819 343 : PyErr_Fetch(&etype, &eval, &etb);
25820 343 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25821 343 : __pyx_memoryview___dealloc__(o);
25822 343 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25823 343 : PyErr_Restore(etype, eval, etb);
25824 : }
25825 343 : Py_CLEAR(p->obj);
25826 343 : Py_CLEAR(p->_size);
25827 343 : Py_CLEAR(p->_array_interface);
25828 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
25829 343 : (*Py_TYPE(o)->tp_free)(o);
25830 : #else
25831 : {
25832 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
25833 : if (tp_free) tp_free(o);
25834 : }
25835 : #endif
25836 : }
25837 :
25838 0 : static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
25839 0 : int e;
25840 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25841 0 : if (p->obj) {
25842 0 : e = (*v)(p->obj, a); if (e) return e;
25843 : }
25844 0 : if (p->_size) {
25845 0 : e = (*v)(p->_size, a); if (e) return e;
25846 : }
25847 0 : if (p->_array_interface) {
25848 0 : e = (*v)(p->_array_interface, a); if (e) return e;
25849 : }
25850 0 : if (p->view.obj) {
25851 0 : e = (*v)(p->view.obj, a); if (e) return e;
25852 : }
25853 : return 0;
25854 : }
25855 :
25856 0 : static int __pyx_tp_clear_memoryview(PyObject *o) {
25857 0 : PyObject* tmp;
25858 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
25859 0 : tmp = ((PyObject*)p->obj);
25860 0 : p->obj = Py_None; Py_INCREF(Py_None);
25861 0 : Py_XDECREF(tmp);
25862 0 : tmp = ((PyObject*)p->_size);
25863 0 : p->_size = Py_None; Py_INCREF(Py_None);
25864 0 : Py_XDECREF(tmp);
25865 0 : tmp = ((PyObject*)p->_array_interface);
25866 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
25867 0 : Py_XDECREF(tmp);
25868 0 : Py_CLEAR(p->view.obj);
25869 0 : return 0;
25870 : }
25871 0 : static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
25872 0 : PyObject *r;
25873 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25874 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25875 0 : Py_DECREF(x);
25876 : return r;
25877 : }
25878 :
25879 0 : static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
25880 0 : if (v) {
25881 0 : return __pyx_memoryview___setitem__(o, i, v);
25882 : }
25883 : else {
25884 0 : __Pyx_TypeName o_type_name;
25885 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
25886 0 : PyErr_Format(PyExc_NotImplementedError,
25887 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
25888 0 : __Pyx_DECREF_TypeName(o_type_name);
25889 0 : return -1;
25890 : }
25891 : }
25892 :
25893 0 : static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
25894 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
25895 : }
25896 :
25897 0 : static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
25898 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
25899 : }
25900 :
25901 0 : static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
25902 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
25903 : }
25904 :
25905 0 : static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
25906 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
25907 : }
25908 :
25909 0 : static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
25910 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
25911 : }
25912 :
25913 0 : static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
25914 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
25915 : }
25916 :
25917 0 : static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
25918 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
25919 : }
25920 :
25921 0 : static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
25922 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
25923 : }
25924 :
25925 0 : static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
25926 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
25927 : }
25928 :
25929 0 : static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
25930 0 : return __pyx_memoryview___repr__(self);
25931 : }
25932 :
25933 : static PyMethodDef __pyx_methods_memoryview[] = {
25934 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
25935 : {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25936 : {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25937 : {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25938 : {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25939 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25940 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
25941 : {0, 0, 0, 0}
25942 : };
25943 :
25944 : static struct PyGetSetDef __pyx_getsets_memoryview[] = {
25945 : {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
25946 : {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
25947 : {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
25948 : {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
25949 : {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
25950 : {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
25951 : {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
25952 : {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
25953 : {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
25954 : {0, 0, 0, 0, 0}
25955 : };
25956 : #if CYTHON_USE_TYPE_SPECS
25957 : #if !CYTHON_COMPILING_IN_LIMITED_API
25958 :
25959 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25960 : #if PY_MAJOR_VERSION < 3
25961 : 0, /*bf_getreadbuffer*/
25962 : #endif
25963 : #if PY_MAJOR_VERSION < 3
25964 : 0, /*bf_getwritebuffer*/
25965 : #endif
25966 : #if PY_MAJOR_VERSION < 3
25967 : 0, /*bf_getsegcount*/
25968 : #endif
25969 : #if PY_MAJOR_VERSION < 3
25970 : 0, /*bf_getcharbuffer*/
25971 : #endif
25972 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
25973 : 0, /*bf_releasebuffer*/
25974 : };
25975 : #endif
25976 : static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
25977 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
25978 : {Py_tp_repr, (void *)__pyx_memoryview___repr__},
25979 : {Py_sq_length, (void *)__pyx_memoryview___len__},
25980 : {Py_sq_item, (void *)__pyx_sq_item_memoryview},
25981 : {Py_mp_length, (void *)__pyx_memoryview___len__},
25982 : {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
25983 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
25984 : {Py_tp_str, (void *)__pyx_memoryview___str__},
25985 : #if defined(Py_bf_getbuffer)
25986 : {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
25987 : #endif
25988 : {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
25989 : {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
25990 : {Py_tp_methods, (void *)__pyx_methods_memoryview},
25991 : {Py_tp_getset, (void *)__pyx_getsets_memoryview},
25992 : {Py_tp_new, (void *)__pyx_tp_new_memoryview},
25993 : {0, 0},
25994 : };
25995 : static PyType_Spec __pyx_type___pyx_memoryview_spec = {
25996 : "scipy.sparse.csgraph._flow.memoryview",
25997 : sizeof(struct __pyx_memoryview_obj),
25998 : 0,
25999 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
26000 : __pyx_type___pyx_memoryview_slots,
26001 : };
26002 : #else
26003 :
26004 : static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26005 : __pyx_memoryview___len__, /*sq_length*/
26006 : 0, /*sq_concat*/
26007 : 0, /*sq_repeat*/
26008 : __pyx_sq_item_memoryview, /*sq_item*/
26009 : 0, /*sq_slice*/
26010 : 0, /*sq_ass_item*/
26011 : 0, /*sq_ass_slice*/
26012 : 0, /*sq_contains*/
26013 : 0, /*sq_inplace_concat*/
26014 : 0, /*sq_inplace_repeat*/
26015 : };
26016 :
26017 : static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26018 : __pyx_memoryview___len__, /*mp_length*/
26019 : __pyx_memoryview___getitem__, /*mp_subscript*/
26020 : __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
26021 : };
26022 :
26023 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26024 : #if PY_MAJOR_VERSION < 3
26025 : 0, /*bf_getreadbuffer*/
26026 : #endif
26027 : #if PY_MAJOR_VERSION < 3
26028 : 0, /*bf_getwritebuffer*/
26029 : #endif
26030 : #if PY_MAJOR_VERSION < 3
26031 : 0, /*bf_getsegcount*/
26032 : #endif
26033 : #if PY_MAJOR_VERSION < 3
26034 : 0, /*bf_getcharbuffer*/
26035 : #endif
26036 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26037 : 0, /*bf_releasebuffer*/
26038 : };
26039 :
26040 : static PyTypeObject __pyx_type___pyx_memoryview = {
26041 : PyVarObject_HEAD_INIT(0, 0)
26042 : "scipy.sparse.csgraph._flow.""memoryview", /*tp_name*/
26043 : sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
26044 : 0, /*tp_itemsize*/
26045 : __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
26046 : #if PY_VERSION_HEX < 0x030800b4
26047 : 0, /*tp_print*/
26048 : #endif
26049 : #if PY_VERSION_HEX >= 0x030800b4
26050 : 0, /*tp_vectorcall_offset*/
26051 : #endif
26052 : 0, /*tp_getattr*/
26053 : 0, /*tp_setattr*/
26054 : #if PY_MAJOR_VERSION < 3
26055 : 0, /*tp_compare*/
26056 : #endif
26057 : #if PY_MAJOR_VERSION >= 3
26058 : 0, /*tp_as_async*/
26059 : #endif
26060 : __pyx_memoryview___repr__, /*tp_repr*/
26061 : 0, /*tp_as_number*/
26062 : &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
26063 : &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
26064 : 0, /*tp_hash*/
26065 : 0, /*tp_call*/
26066 : __pyx_memoryview___str__, /*tp_str*/
26067 : 0, /*tp_getattro*/
26068 : 0, /*tp_setattro*/
26069 : &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
26070 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26071 : 0, /*tp_doc*/
26072 : __pyx_tp_traverse_memoryview, /*tp_traverse*/
26073 : __pyx_tp_clear_memoryview, /*tp_clear*/
26074 : 0, /*tp_richcompare*/
26075 : 0, /*tp_weaklistoffset*/
26076 : 0, /*tp_iter*/
26077 : 0, /*tp_iternext*/
26078 : __pyx_methods_memoryview, /*tp_methods*/
26079 : 0, /*tp_members*/
26080 : __pyx_getsets_memoryview, /*tp_getset*/
26081 : 0, /*tp_base*/
26082 : 0, /*tp_dict*/
26083 : 0, /*tp_descr_get*/
26084 : 0, /*tp_descr_set*/
26085 : #if !CYTHON_USE_TYPE_SPECS
26086 : 0, /*tp_dictoffset*/
26087 : #endif
26088 : 0, /*tp_init*/
26089 : 0, /*tp_alloc*/
26090 : __pyx_tp_new_memoryview, /*tp_new*/
26091 : 0, /*tp_free*/
26092 : 0, /*tp_is_gc*/
26093 : 0, /*tp_bases*/
26094 : 0, /*tp_mro*/
26095 : 0, /*tp_cache*/
26096 : 0, /*tp_subclasses*/
26097 : 0, /*tp_weaklist*/
26098 : 0, /*tp_del*/
26099 : 0, /*tp_version_tag*/
26100 : #if PY_VERSION_HEX >= 0x030400a1
26101 : #if CYTHON_USE_TP_FINALIZE
26102 : 0, /*tp_finalize*/
26103 : #else
26104 : NULL, /*tp_finalize*/
26105 : #endif
26106 : #endif
26107 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26108 : 0, /*tp_vectorcall*/
26109 : #endif
26110 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26111 : 0, /*tp_print*/
26112 : #endif
26113 : #if PY_VERSION_HEX >= 0x030C0000
26114 : 0, /*tp_watched*/
26115 : #endif
26116 : #if PY_VERSION_HEX >= 0x030d00A4
26117 : 0, /*tp_versions_used*/
26118 : #endif
26119 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26120 : 0, /*tp_pypy_flags*/
26121 : #endif
26122 : };
26123 : #endif
26124 : static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26125 :
26126 29 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26127 29 : struct __pyx_memoryviewslice_obj *p;
26128 29 : PyObject *o = __pyx_tp_new_memoryview(t, a, k);
26129 29 : if (unlikely(!o)) return 0;
26130 29 : p = ((struct __pyx_memoryviewslice_obj *)o);
26131 29 : p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26132 29 : p->from_object = Py_None; Py_INCREF(Py_None);
26133 29 : p->from_slice.memview = NULL;
26134 29 : return o;
26135 : }
26136 :
26137 29 : static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26138 29 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26139 : #if CYTHON_USE_TP_FINALIZE
26140 29 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
26141 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
26142 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
26143 : }
26144 : }
26145 : #endif
26146 29 : PyObject_GC_UnTrack(o);
26147 : {
26148 29 : PyObject *etype, *eval, *etb;
26149 29 : PyErr_Fetch(&etype, &eval, &etb);
26150 29 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
26151 29 : __pyx_memoryviewslice___dealloc__(o);
26152 29 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
26153 29 : PyErr_Restore(etype, eval, etb);
26154 : }
26155 29 : Py_CLEAR(p->from_object);
26156 29 : PyObject_GC_Track(o);
26157 29 : __pyx_tp_dealloc_memoryview(o);
26158 : }
26159 :
26160 0 : static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26161 0 : int e;
26162 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26163 0 : e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26164 0 : if (p->from_object) {
26165 0 : e = (*v)(p->from_object, a); if (e) return e;
26166 : }
26167 : return 0;
26168 : }
26169 :
26170 0 : static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26171 0 : PyObject* tmp;
26172 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26173 0 : __pyx_tp_clear_memoryview(o);
26174 0 : tmp = ((PyObject*)p->from_object);
26175 0 : p->from_object = Py_None; Py_INCREF(Py_None);
26176 0 : Py_XDECREF(tmp);
26177 0 : __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
26178 0 : return 0;
26179 : }
26180 :
26181 : static PyMethodDef __pyx_methods__memoryviewslice[] = {
26182 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26183 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
26184 : {0, 0, 0, 0}
26185 : };
26186 : #if CYTHON_USE_TYPE_SPECS
26187 : static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
26188 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
26189 : {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
26190 : {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
26191 : {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
26192 : {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
26193 : {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
26194 : {0, 0},
26195 : };
26196 : static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
26197 : "scipy.sparse.csgraph._flow._memoryviewslice",
26198 : sizeof(struct __pyx_memoryviewslice_obj),
26199 : 0,
26200 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
26201 : __pyx_type___pyx_memoryviewslice_slots,
26202 : };
26203 : #else
26204 :
26205 : static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26206 : PyVarObject_HEAD_INIT(0, 0)
26207 : "scipy.sparse.csgraph._flow.""_memoryviewslice", /*tp_name*/
26208 : sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26209 : 0, /*tp_itemsize*/
26210 : __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26211 : #if PY_VERSION_HEX < 0x030800b4
26212 : 0, /*tp_print*/
26213 : #endif
26214 : #if PY_VERSION_HEX >= 0x030800b4
26215 : 0, /*tp_vectorcall_offset*/
26216 : #endif
26217 : 0, /*tp_getattr*/
26218 : 0, /*tp_setattr*/
26219 : #if PY_MAJOR_VERSION < 3
26220 : 0, /*tp_compare*/
26221 : #endif
26222 : #if PY_MAJOR_VERSION >= 3
26223 : 0, /*tp_as_async*/
26224 : #endif
26225 : #if CYTHON_COMPILING_IN_PYPY || 0
26226 : __pyx_memoryview___repr__, /*tp_repr*/
26227 : #else
26228 : 0, /*tp_repr*/
26229 : #endif
26230 : 0, /*tp_as_number*/
26231 : 0, /*tp_as_sequence*/
26232 : 0, /*tp_as_mapping*/
26233 : 0, /*tp_hash*/
26234 : 0, /*tp_call*/
26235 : #if CYTHON_COMPILING_IN_PYPY || 0
26236 : __pyx_memoryview___str__, /*tp_str*/
26237 : #else
26238 : 0, /*tp_str*/
26239 : #endif
26240 : 0, /*tp_getattro*/
26241 : 0, /*tp_setattro*/
26242 : 0, /*tp_as_buffer*/
26243 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
26244 : PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
26245 : __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26246 : __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26247 : 0, /*tp_richcompare*/
26248 : 0, /*tp_weaklistoffset*/
26249 : 0, /*tp_iter*/
26250 : 0, /*tp_iternext*/
26251 : __pyx_methods__memoryviewslice, /*tp_methods*/
26252 : 0, /*tp_members*/
26253 : 0, /*tp_getset*/
26254 : 0, /*tp_base*/
26255 : 0, /*tp_dict*/
26256 : 0, /*tp_descr_get*/
26257 : 0, /*tp_descr_set*/
26258 : #if !CYTHON_USE_TYPE_SPECS
26259 : 0, /*tp_dictoffset*/
26260 : #endif
26261 : 0, /*tp_init*/
26262 : 0, /*tp_alloc*/
26263 : __pyx_tp_new__memoryviewslice, /*tp_new*/
26264 : 0, /*tp_free*/
26265 : 0, /*tp_is_gc*/
26266 : 0, /*tp_bases*/
26267 : 0, /*tp_mro*/
26268 : 0, /*tp_cache*/
26269 : 0, /*tp_subclasses*/
26270 : 0, /*tp_weaklist*/
26271 : 0, /*tp_del*/
26272 : 0, /*tp_version_tag*/
26273 : #if PY_VERSION_HEX >= 0x030400a1
26274 : #if CYTHON_USE_TP_FINALIZE
26275 : 0, /*tp_finalize*/
26276 : #else
26277 : NULL, /*tp_finalize*/
26278 : #endif
26279 : #endif
26280 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26281 : 0, /*tp_vectorcall*/
26282 : #endif
26283 : #if __PYX_NEED_TP_PRINT_SLOT == 1
26284 : 0, /*tp_print*/
26285 : #endif
26286 : #if PY_VERSION_HEX >= 0x030C0000
26287 : 0, /*tp_watched*/
26288 : #endif
26289 : #if PY_VERSION_HEX >= 0x030d00A4
26290 : 0, /*tp_versions_used*/
26291 : #endif
26292 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26293 : 0, /*tp_pypy_flags*/
26294 : #endif
26295 : };
26296 : #endif
26297 :
26298 : static PyMethodDef __pyx_methods[] = {
26299 : {0, 0, 0, 0}
26300 : };
26301 : #ifndef CYTHON_SMALL_CODE
26302 : #if defined(__clang__)
26303 : #define CYTHON_SMALL_CODE
26304 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26305 : #define CYTHON_SMALL_CODE __attribute__((cold))
26306 : #else
26307 : #define CYTHON_SMALL_CODE
26308 : #endif
26309 : #endif
26310 : /* #### Code section: pystring_table ### */
26311 :
26312 3 : static int __Pyx_CreateStringTabAndInitStrings(void) {
26313 3 : __Pyx_StringTabEntry __pyx_string_tab[] = {
26314 3 : {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
26315 3 : {&__pyx_kp_u_0_and, __pyx_k_0_and, sizeof(__pyx_k_0_and), 0, 1, 0, 0},
26316 3 : {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26317 3 : {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
26318 3 : {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
26319 3 : {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
26320 3 : {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
26321 3 : {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
26322 3 : {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
26323 3 : {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
26324 3 : {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
26325 3 : {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
26326 3 : {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
26327 3 : {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26328 3 : {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
26329 3 : {&__pyx_n_s_ITYPE, __pyx_k_ITYPE, sizeof(__pyx_k_ITYPE), 0, 0, 1, 1},
26330 3 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
26331 3 : {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
26332 3 : {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26333 3 : {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
26334 3 : {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26335 3 : {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
26336 3 : {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
26337 3 : {&__pyx_n_s_MaximumFlowResult, __pyx_k_MaximumFlowResult, sizeof(__pyx_k_MaximumFlowResult), 0, 0, 1, 1},
26338 3 : {&__pyx_n_s_MaximumFlowResult___init, __pyx_k_MaximumFlowResult___init, sizeof(__pyx_k_MaximumFlowResult___init), 0, 0, 1, 1},
26339 3 : {&__pyx_n_s_MaximumFlowResult___repr, __pyx_k_MaximumFlowResult___repr, sizeof(__pyx_k_MaximumFlowResult___repr), 0, 0, 1, 1},
26340 3 : {&__pyx_kp_u_MaximumFlowResult_with_value_of, __pyx_k_MaximumFlowResult_with_value_of, sizeof(__pyx_k_MaximumFlowResult_with_value_of), 0, 1, 0, 0},
26341 3 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26342 3 : {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
26343 3 : {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26344 3 : {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
26345 3 : {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
26346 3 : {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26347 3 : {&__pyx_kp_s_Represents_the_result_of_a_maxim, __pyx_k_Represents_the_result_of_a_maxim, sizeof(__pyx_k_Represents_the_result_of_a_maxim), 0, 0, 1, 0},
26348 3 : {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
26349 3 : {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
26350 3 : {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26351 3 : {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
26352 3 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26353 3 : {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26354 3 : {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
26355 3 : {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
26356 3 : {&__pyx_n_s__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 1, 1},
26357 3 : {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
26358 3 : {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
26359 3 : {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
26360 3 : {&__pyx_n_s_a_data_view, __pyx_k_a_data_view, sizeof(__pyx_k_a_data_view), 0, 0, 1, 1},
26361 3 : {&__pyx_n_s_a_end, __pyx_k_a_end, sizeof(__pyx_k_a_end), 0, 0, 1, 1},
26362 3 : {&__pyx_n_s_a_indices_view, __pyx_k_a_indices_view, sizeof(__pyx_k_a_indices_view), 0, 0, 1, 1},
26363 3 : {&__pyx_n_s_a_indptr_view, __pyx_k_a_indptr_view, sizeof(__pyx_k_a_indptr_view), 0, 0, 1, 1},
26364 3 : {&__pyx_n_s_a_ptr, __pyx_k_a_ptr, sizeof(__pyx_k_a_ptr), 0, 0, 1, 1},
26365 3 : {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
26366 3 : {&__pyx_n_s_add_reverse_edges, __pyx_k_add_reverse_edges, sizeof(__pyx_k_add_reverse_edges), 0, 0, 1, 1},
26367 3 : {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26368 3 : {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
26369 3 : {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
26370 3 : {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
26371 3 : {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
26372 3 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
26373 3 : {&__pyx_n_s_at, __pyx_k_at, sizeof(__pyx_k_at), 0, 0, 1, 1},
26374 3 : {&__pyx_n_s_at_end, __pyx_k_at_end, sizeof(__pyx_k_at_end), 0, 0, 1, 1},
26375 3 : {&__pyx_n_s_at_indices_view, __pyx_k_at_indices_view, sizeof(__pyx_k_at_indices_view), 0, 0, 1, 1},
26376 3 : {&__pyx_n_s_at_indptr_view, __pyx_k_at_indptr_view, sizeof(__pyx_k_at_indptr_view), 0, 0, 1, 1},
26377 3 : {&__pyx_n_s_at_ptr, __pyx_k_at_ptr, sizeof(__pyx_k_at_ptr), 0, 0, 1, 1},
26378 3 : {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
26379 3 : {&__pyx_n_s_b_data, __pyx_k_b_data, sizeof(__pyx_k_b_data), 0, 0, 1, 1},
26380 3 : {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
26381 3 : {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
26382 3 : {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
26383 3 : {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
26384 3 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
26385 3 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26386 3 : {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
26387 3 : {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
26388 3 : {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26389 3 : {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26390 3 : {&__pyx_n_s_convert_pydata_sparse_to_scipy, __pyx_k_convert_pydata_sparse_to_scipy, sizeof(__pyx_k_convert_pydata_sparse_to_scipy), 0, 0, 1, 1},
26391 3 : {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
26392 3 : {&__pyx_n_s_csgraph, __pyx_k_csgraph, sizeof(__pyx_k_csgraph), 0, 0, 1, 1},
26393 3 : {&__pyx_n_s_csgraph_indices, __pyx_k_csgraph_indices, sizeof(__pyx_k_csgraph_indices), 0, 0, 1, 1},
26394 3 : {&__pyx_n_s_csgraph_indptr, __pyx_k_csgraph_indptr, sizeof(__pyx_k_csgraph_indptr), 0, 0, 1, 1},
26395 3 : {&__pyx_n_s_csgraph_orig, __pyx_k_csgraph_orig, sizeof(__pyx_k_csgraph_orig), 0, 0, 1, 1},
26396 3 : {&__pyx_n_u_csr, __pyx_k_csr, sizeof(__pyx_k_csr), 0, 1, 0, 1},
26397 3 : {&__pyx_n_s_csr_array, __pyx_k_csr_array, sizeof(__pyx_k_csr_array), 0, 0, 1, 1},
26398 3 : {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
26399 3 : {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
26400 3 : {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
26401 3 : {&__pyx_n_u_dinic, __pyx_k_dinic, sizeof(__pyx_k_dinic), 0, 1, 0, 1},
26402 3 : {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
26403 3 : {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
26404 3 : {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26405 3 : {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26406 3 : {&__pyx_n_u_edmonds_karp, __pyx_k_edmonds_karp, sizeof(__pyx_k_edmonds_karp), 0, 1, 0, 1},
26407 3 : {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
26408 3 : {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
26409 3 : {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
26410 3 : {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26411 3 : {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
26412 3 : {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
26413 3 : {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
26414 3 : {&__pyx_n_s_flow, __pyx_k_flow, sizeof(__pyx_k_flow), 0, 0, 1, 1},
26415 3 : {&__pyx_n_s_flow_array, __pyx_k_flow_array, sizeof(__pyx_k_flow_array), 0, 0, 1, 1},
26416 3 : {&__pyx_n_s_flow_matrix, __pyx_k_flow_matrix, sizeof(__pyx_k_flow_matrix), 0, 0, 1, 1},
26417 3 : {&__pyx_n_s_flow_value, __pyx_k_flow_value, sizeof(__pyx_k_flow_value), 0, 0, 1, 1},
26418 3 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
26419 3 : {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26420 3 : {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26421 3 : {&__pyx_n_s_from_scipy_sparse, __pyx_k_from_scipy_sparse, sizeof(__pyx_k_from_scipy_sparse), 0, 0, 1, 1},
26422 3 : {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
26423 3 : {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26424 3 : {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
26425 3 : {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
26426 3 : {&__pyx_kp_u_graph_capacities_must_be_integer, __pyx_k_graph_capacities_must_be_integer, sizeof(__pyx_k_graph_capacities_must_be_integer), 0, 1, 0, 0},
26427 3 : {&__pyx_kp_u_graph_must_be_in_CSR_format, __pyx_k_graph_must_be_in_CSR_format, sizeof(__pyx_k_graph_must_be_in_CSR_format), 0, 1, 0, 0},
26428 3 : {&__pyx_kp_u_graph_must_be_specified_as_a_squ, __pyx_k_graph_must_be_specified_as_a_squ, sizeof(__pyx_k_graph_must_be_specified_as_a_squ), 0, 1, 0, 0},
26429 3 : {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices, sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
26430 3 : {&__pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_k_home_czgdp18079_Quansight_scipy, sizeof(__pyx_k_home_czgdp18079_Quansight_scipy), 0, 0, 1, 0},
26431 3 : {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
26432 3 : {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
26433 3 : {&__pyx_n_s_iinfo, __pyx_k_iinfo, sizeof(__pyx_k_iinfo), 0, 0, 1, 1},
26434 3 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
26435 3 : {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
26436 3 : {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
26437 3 : {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
26438 3 : {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
26439 3 : {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
26440 3 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
26441 3 : {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
26442 3 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
26443 3 : {&__pyx_n_s_is_pydata_sparse, __pyx_k_is_pydata_sparse, sizeof(__pyx_k_is_pydata_sparse), 0, 0, 1, 1},
26444 3 : {&__pyx_n_s_is_pydata_spmatrix, __pyx_k_is_pydata_spmatrix, sizeof(__pyx_k_is_pydata_spmatrix), 0, 0, 1, 1},
26445 3 : {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
26446 3 : {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
26447 3 : {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26448 3 : {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
26449 3 : {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
26450 3 : {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
26451 3 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
26452 3 : {&__pyx_n_s_make_edge_pointers, __pyx_k_make_edge_pointers, sizeof(__pyx_k_make_edge_pointers), 0, 0, 1, 1},
26453 3 : {&__pyx_n_s_make_tails, __pyx_k_make_tails, sizeof(__pyx_k_make_tails), 0, 0, 1, 1},
26454 3 : {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
26455 3 : {&__pyx_n_s_maximum_flow, __pyx_k_maximum_flow, sizeof(__pyx_k_maximum_flow), 0, 0, 1, 1},
26456 3 : {&__pyx_kp_u_maximum_flow_csgraph_source_sin, __pyx_k_maximum_flow_csgraph_source_sin, sizeof(__pyx_k_maximum_flow_csgraph_source_sin), 0, 1, 0, 0},
26457 3 : {&__pyx_kp_u_maximum_flow_line_36, __pyx_k_maximum_flow_line_36, sizeof(__pyx_k_maximum_flow_line_36), 0, 1, 0, 0},
26458 3 : {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
26459 3 : {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
26460 3 : {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
26461 3 : {&__pyx_kp_u_method_is_not_supported_yet, __pyx_k_method_is_not_supported_yet, sizeof(__pyx_k_method_is_not_supported_yet), 0, 1, 0, 0},
26462 3 : {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
26463 3 : {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
26464 3 : {&__pyx_n_s_move_a, __pyx_k_move_a, sizeof(__pyx_k_move_a), 0, 0, 1, 1},
26465 3 : {&__pyx_n_s_move_at, __pyx_k_move_at, sizeof(__pyx_k_move_at), 0, 0, 1, 1},
26466 3 : {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
26467 3 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
26468 3 : {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26469 3 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26470 3 : {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
26471 3 : {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1},
26472 3 : {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26473 3 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
26474 3 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26475 3 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
26476 3 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
26477 3 : {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
26478 3 : {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
26479 3 : {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26480 3 : {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
26481 3 : {&__pyx_n_s_pydata_sparse_cls, __pyx_k_pydata_sparse_cls, sizeof(__pyx_k_pydata_sparse_cls), 0, 0, 1, 1},
26482 3 : {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26483 3 : {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26484 3 : {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26485 3 : {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26486 3 : {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26487 3 : {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26488 3 : {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26489 3 : {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
26490 3 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
26491 3 : {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26492 3 : {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26493 3 : {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26494 3 : {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
26495 3 : {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
26496 3 : {&__pyx_n_s_res_data, __pyx_k_res_data, sizeof(__pyx_k_res_data), 0, 0, 1, 1},
26497 3 : {&__pyx_n_s_res_data_view, __pyx_k_res_data_view, sizeof(__pyx_k_res_data_view), 0, 0, 1, 1},
26498 3 : {&__pyx_n_s_res_indices, __pyx_k_res_indices, sizeof(__pyx_k_res_indices), 0, 0, 1, 1},
26499 3 : {&__pyx_n_s_res_indices_view, __pyx_k_res_indices_view, sizeof(__pyx_k_res_indices_view), 0, 0, 1, 1},
26500 3 : {&__pyx_n_s_res_indptr, __pyx_k_res_indptr, sizeof(__pyx_k_res_indptr), 0, 0, 1, 1},
26501 3 : {&__pyx_n_s_res_indptr_view, __pyx_k_res_indptr_view, sizeof(__pyx_k_res_indptr_view), 0, 0, 1, 1},
26502 3 : {&__pyx_n_s_res_ptr, __pyx_k_res_ptr, sizeof(__pyx_k_res_ptr), 0, 0, 1, 1},
26503 3 : {&__pyx_n_s_rev_edge_ptr, __pyx_k_rev_edge_ptr, sizeof(__pyx_k_rev_edge_ptr), 0, 0, 1, 1},
26504 3 : {&__pyx_n_s_safe_downcast_indices, __pyx_k_safe_downcast_indices, sizeof(__pyx_k_safe_downcast_indices), 0, 0, 1, 1},
26505 3 : {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
26506 3 : {&__pyx_n_s_scipy_sparse__sputils, __pyx_k_scipy_sparse__sputils, sizeof(__pyx_k_scipy_sparse__sputils), 0, 0, 1, 1},
26507 3 : {&__pyx_n_s_scipy_sparse_csgraph__flow, __pyx_k_scipy_sparse_csgraph__flow, sizeof(__pyx_k_scipy_sparse_csgraph__flow), 0, 0, 1, 1},
26508 3 : {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
26509 3 : {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
26510 3 : {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26511 3 : {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26512 3 : {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
26513 3 : {&__pyx_n_s_sink, __pyx_k_sink, sizeof(__pyx_k_sink), 0, 0, 1, 1},
26514 3 : {&__pyx_kp_u_sink_value_must_be_between, __pyx_k_sink_value_must_be_between, sizeof(__pyx_k_sink_value_must_be_between), 0, 1, 0, 0},
26515 3 : {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
26516 3 : {&__pyx_n_s_sorted_indices, __pyx_k_sorted_indices, sizeof(__pyx_k_sorted_indices), 0, 0, 1, 1},
26517 3 : {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
26518 3 : {&__pyx_kp_u_source_and_sink_vertices_must_di, __pyx_k_source_and_sink_vertices_must_di, sizeof(__pyx_k_source_and_sink_vertices_must_di), 0, 1, 0, 0},
26519 3 : {&__pyx_n_s_source_flow, __pyx_k_source_flow, sizeof(__pyx_k_source_flow), 0, 0, 1, 1},
26520 3 : {&__pyx_kp_u_source_value_must_be_between, __pyx_k_source_value_must_be_between, sizeof(__pyx_k_source_value_must_be_between), 0, 1, 0, 0},
26521 3 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
26522 3 : {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
26523 3 : {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
26524 3 : {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
26525 3 : {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26526 3 : {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
26527 3 : {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26528 3 : {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26529 3 : {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
26530 3 : {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
26531 3 : {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
26532 3 : {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
26533 3 : {&__pyx_n_s_tails, __pyx_k_tails, sizeof(__pyx_k_tails), 0, 0, 1, 1},
26534 3 : {&__pyx_n_s_target_format, __pyx_k_target_format, sizeof(__pyx_k_target_format), 0, 0, 1, 1},
26535 3 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
26536 3 : {&__pyx_n_s_tools, __pyx_k_tools, sizeof(__pyx_k_tools), 0, 0, 1, 1},
26537 3 : {&__pyx_n_s_transpose, __pyx_k_transpose, sizeof(__pyx_k_transpose), 0, 0, 1, 1},
26538 3 : {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
26539 3 : {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
26540 3 : {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
26541 3 : {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26542 3 : {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
26543 3 : {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
26544 3 : {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
26545 : {0, 0, 0, 0, 0, 0, 0}
26546 : };
26547 3 : return __Pyx_InitStrings(__pyx_string_tab);
26548 : }
26549 : /* #### Code section: cached_builtins ### */
26550 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
26551 3 : __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 236, __pyx_L1_error)
26552 3 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 238, __pyx_L1_error)
26553 3 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 382, __pyx_L1_error)
26554 3 : __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 100, __pyx_L1_error)
26555 3 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 156, __pyx_L1_error)
26556 3 : __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 159, __pyx_L1_error)
26557 3 : __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 373, __pyx_L1_error)
26558 3 : __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
26559 3 : __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
26560 3 : __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
26561 3 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error)
26562 : return 0;
26563 : __pyx_L1_error:;
26564 : return -1;
26565 : }
26566 : /* #### Code section: cached_constants ### */
26567 :
26568 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
26569 : __Pyx_RefNannyDeclarations
26570 3 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
26571 :
26572 : /* "View.MemoryView":582
26573 : * def suboffsets(self):
26574 : * if self.view.suboffsets == NULL:
26575 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
26576 : *
26577 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
26578 : */
26579 3 : __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 582, __pyx_L1_error)
26580 3 : __Pyx_GOTREF(__pyx_tuple__4);
26581 3 : __Pyx_INCREF(__pyx_int_neg_1);
26582 3 : __Pyx_GIVEREF(__pyx_int_neg_1);
26583 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(1, 582, __pyx_L1_error);
26584 3 : __Pyx_GIVEREF(__pyx_tuple__4);
26585 :
26586 : /* "View.MemoryView":679
26587 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
26588 : *
26589 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
26590 : * have_slices = False
26591 : * seen_ellipsis = False
26592 : */
26593 3 : __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error)
26594 3 : __Pyx_GOTREF(__pyx_slice__5);
26595 3 : __Pyx_GIVEREF(__pyx_slice__5);
26596 :
26597 : /* "(tree fragment)":4
26598 : * cdef object __pyx_PickleError
26599 : * cdef object __pyx_result
26600 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
26601 : * from pickle import PickleError as __pyx_PickleError
26602 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
26603 : */
26604 3 : __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
26605 3 : __Pyx_GOTREF(__pyx_tuple__8);
26606 3 : __Pyx_GIVEREF(__pyx_tuple__8);
26607 :
26608 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
26609 : * __pyx_import_array()
26610 : * except Exception:
26611 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
26612 : *
26613 : * cdef inline int import_umath() except -1:
26614 : */
26615 3 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error)
26616 3 : __Pyx_GOTREF(__pyx_tuple__9);
26617 3 : __Pyx_GIVEREF(__pyx_tuple__9);
26618 :
26619 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
26620 : * _import_umath()
26621 : * except Exception:
26622 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
26623 : *
26624 : * cdef inline int import_ufunc() except -1:
26625 : */
26626 3 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error)
26627 3 : __Pyx_GOTREF(__pyx_tuple__10);
26628 3 : __Pyx_GIVEREF(__pyx_tuple__10);
26629 :
26630 : /* "scipy/sparse/csgraph/_flow.pyx":236
26631 : * csgraph = convert_pydata_sparse_to_scipy(csgraph, target_format="csr")
26632 : * if not (issparse(csgraph) and csgraph.format == "csr"):
26633 : * raise TypeError("graph must be in CSR format") # <<<<<<<<<<<<<<
26634 : * if not issubclass(csgraph.dtype.type, np.integer):
26635 : * raise ValueError("graph capacities must be integers")
26636 : */
26637 3 : __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_graph_must_be_in_CSR_format); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 236, __pyx_L1_error)
26638 3 : __Pyx_GOTREF(__pyx_tuple__11);
26639 3 : __Pyx_GIVEREF(__pyx_tuple__11);
26640 :
26641 : /* "scipy/sparse/csgraph/_flow.pyx":238
26642 : * raise TypeError("graph must be in CSR format")
26643 : * if not issubclass(csgraph.dtype.type, np.integer):
26644 : * raise ValueError("graph capacities must be integers") # <<<<<<<<<<<<<<
26645 : * elif csgraph.dtype != ITYPE:
26646 : * csgraph = csgraph.astype(ITYPE)
26647 : */
26648 3 : __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_graph_capacities_must_be_integer); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 238, __pyx_L1_error)
26649 3 : __Pyx_GOTREF(__pyx_tuple__12);
26650 3 : __Pyx_GIVEREF(__pyx_tuple__12);
26651 :
26652 : /* "scipy/sparse/csgraph/_flow.pyx":242
26653 : * csgraph = csgraph.astype(ITYPE)
26654 : * if source == sink:
26655 : * raise ValueError("source and sink vertices must differ") # <<<<<<<<<<<<<<
26656 : * if csgraph.shape[0] != csgraph.shape[1]:
26657 : * raise ValueError("graph must be specified as a square matrix.")
26658 : */
26659 3 : __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_source_and_sink_vertices_must_di); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 242, __pyx_L1_error)
26660 3 : __Pyx_GOTREF(__pyx_tuple__13);
26661 3 : __Pyx_GIVEREF(__pyx_tuple__13);
26662 :
26663 : /* "scipy/sparse/csgraph/_flow.pyx":244
26664 : * raise ValueError("source and sink vertices must differ")
26665 : * if csgraph.shape[0] != csgraph.shape[1]:
26666 : * raise ValueError("graph must be specified as a square matrix.") # <<<<<<<<<<<<<<
26667 : * if source < 0 or source >= csgraph.shape[0]:
26668 : * raise ValueError('source value ({}) must be between '.format(source) +
26669 : */
26670 3 : __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_graph_must_be_specified_as_a_squ); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 244, __pyx_L1_error)
26671 3 : __Pyx_GOTREF(__pyx_tuple__14);
26672 3 : __Pyx_GIVEREF(__pyx_tuple__14);
26673 :
26674 : /* "View.MemoryView":100
26675 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
26676 : * try:
26677 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
26678 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
26679 : * else:
26680 : */
26681 3 : __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 100, __pyx_L1_error)
26682 3 : __Pyx_GOTREF(__pyx_tuple__15);
26683 3 : __Pyx_GIVEREF(__pyx_tuple__15);
26684 3 : __pyx_tuple__16 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 100, __pyx_L1_error)
26685 3 : __Pyx_GOTREF(__pyx_tuple__16);
26686 3 : __Pyx_GIVEREF(__pyx_tuple__16);
26687 :
26688 : /* "View.MemoryView":101
26689 : * try:
26690 : * if __import__("sys").version_info >= (3, 3):
26691 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
26692 : * else:
26693 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
26694 : */
26695 3 : __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 101, __pyx_L1_error)
26696 3 : __Pyx_GOTREF(__pyx_tuple__17);
26697 3 : __Pyx_GIVEREF(__pyx_tuple__17);
26698 :
26699 : /* "View.MemoryView":103
26700 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
26701 : * else:
26702 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
26703 : * except:
26704 : *
26705 : */
26706 3 : __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 103, __pyx_L1_error)
26707 3 : __Pyx_GOTREF(__pyx_tuple__18);
26708 3 : __Pyx_GIVEREF(__pyx_tuple__18);
26709 :
26710 : /* "View.MemoryView":309
26711 : * return self.name
26712 : *
26713 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
26714 : * cdef strided = Enum("<strided and direct>") # default
26715 : * cdef indirect = Enum("<strided and indirect>")
26716 : */
26717 3 : __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 309, __pyx_L1_error)
26718 3 : __Pyx_GOTREF(__pyx_tuple__19);
26719 3 : __Pyx_GIVEREF(__pyx_tuple__19);
26720 :
26721 : /* "View.MemoryView":310
26722 : *
26723 : * cdef generic = Enum("<strided and direct or indirect>")
26724 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
26725 : * cdef indirect = Enum("<strided and indirect>")
26726 : *
26727 : */
26728 3 : __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 310, __pyx_L1_error)
26729 3 : __Pyx_GOTREF(__pyx_tuple__20);
26730 3 : __Pyx_GIVEREF(__pyx_tuple__20);
26731 :
26732 : /* "View.MemoryView":311
26733 : * cdef generic = Enum("<strided and direct or indirect>")
26734 : * cdef strided = Enum("<strided and direct>") # default
26735 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
26736 : *
26737 : *
26738 : */
26739 3 : __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 311, __pyx_L1_error)
26740 3 : __Pyx_GOTREF(__pyx_tuple__21);
26741 3 : __Pyx_GIVEREF(__pyx_tuple__21);
26742 :
26743 : /* "View.MemoryView":314
26744 : *
26745 : *
26746 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
26747 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
26748 : *
26749 : */
26750 3 : __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 314, __pyx_L1_error)
26751 3 : __Pyx_GOTREF(__pyx_tuple__22);
26752 3 : __Pyx_GIVEREF(__pyx_tuple__22);
26753 :
26754 : /* "View.MemoryView":315
26755 : *
26756 : * cdef contiguous = Enum("<contiguous and direct>")
26757 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
26758 : *
26759 : *
26760 : */
26761 3 : __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 315, __pyx_L1_error)
26762 3 : __Pyx_GOTREF(__pyx_tuple__23);
26763 3 : __Pyx_GIVEREF(__pyx_tuple__23);
26764 :
26765 : /* "(tree fragment)":1
26766 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
26767 : * cdef object __pyx_PickleError
26768 : * cdef object __pyx_result
26769 : */
26770 3 : __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 1, __pyx_L1_error)
26771 3 : __Pyx_GOTREF(__pyx_tuple__24);
26772 3 : __Pyx_GIVEREF(__pyx_tuple__24);
26773 3 : __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 1, __pyx_L1_error)
26774 :
26775 : /* "scipy/sparse/csgraph/_flow.pyx":28
26776 : * """
26777 : *
26778 : * def __init__(self, flow_value, flow): # <<<<<<<<<<<<<<
26779 : * self.flow_value = flow_value
26780 : * self.flow = flow
26781 : */
26782 3 : __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_flow_value, __pyx_n_s_flow); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 28, __pyx_L1_error)
26783 3 : __Pyx_GOTREF(__pyx_tuple__26);
26784 3 : __Pyx_GIVEREF(__pyx_tuple__26);
26785 3 : __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_init, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 28, __pyx_L1_error)
26786 :
26787 : /* "scipy/sparse/csgraph/_flow.pyx":32
26788 : * self.flow = flow
26789 : *
26790 : * def __repr__(self): # <<<<<<<<<<<<<<
26791 : * return 'MaximumFlowResult with value of %d' % self.flow_value
26792 : *
26793 : */
26794 3 : __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 32, __pyx_L1_error)
26795 3 : __Pyx_GOTREF(__pyx_tuple__28);
26796 3 : __Pyx_GIVEREF(__pyx_tuple__28);
26797 3 : __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_repr, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 32, __pyx_L1_error)
26798 :
26799 : /* "scipy/sparse/csgraph/_flow.pyx":36
26800 : *
26801 : *
26802 : * def maximum_flow(csgraph, source, sink, *, method='dinic'): # <<<<<<<<<<<<<<
26803 : * r"""
26804 : * maximum_flow(csgraph, source, sink)
26805 : */
26806 3 : __pyx_tuple__30 = PyTuple_Pack(16, __pyx_n_s_csgraph, __pyx_n_s_source, __pyx_n_s_sink, __pyx_n_s_method, __pyx_n_s_csgraph_orig, __pyx_n_s_is_pydata_sparse, __pyx_n_s_pydata_sparse_cls, __pyx_n_s_csgraph_indices, __pyx_n_s_csgraph_indptr, __pyx_n_s_m, __pyx_n_s_rev_edge_ptr, __pyx_n_s_tails, __pyx_n_s_flow, __pyx_n_s_flow_array, __pyx_n_s_flow_matrix, __pyx_n_s_source_flow); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 36, __pyx_L1_error)
26807 3 : __Pyx_GOTREF(__pyx_tuple__30);
26808 3 : __Pyx_GIVEREF(__pyx_tuple__30);
26809 3 : __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 1, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_maximum_flow, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 36, __pyx_L1_error)
26810 :
26811 : /* "scipy/sparse/csgraph/_flow.pyx":287
26812 : *
26813 : *
26814 : * def _add_reverse_edges(a): # <<<<<<<<<<<<<<
26815 : * """Add reversed edges to all edges in a graph.
26816 : *
26817 : */
26818 3 : __pyx_tuple__32 = PyTuple_Pack(22, __pyx_n_s_a, __pyx_n_s_n, __pyx_n_s_a_data_view, __pyx_n_s_a_indices_view, __pyx_n_s_a_indptr_view, __pyx_n_s_at, __pyx_n_s_at_indices_view, __pyx_n_s_at_indptr_view, __pyx_n_s_res_data, __pyx_n_s_res_data_view, __pyx_n_s_res_indices, __pyx_n_s_res_indices_view, __pyx_n_s_res_indptr, __pyx_n_s_res_indptr_view, __pyx_n_s_i, __pyx_n_s_res_ptr, __pyx_n_s_a_ptr, __pyx_n_s_a_end, __pyx_n_s_at_ptr, __pyx_n_s_at_end, __pyx_n_s_move_a, __pyx_n_s_move_at); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 287, __pyx_L1_error)
26819 3 : __Pyx_GOTREF(__pyx_tuple__32);
26820 3 : __Pyx_GIVEREF(__pyx_tuple__32);
26821 3 : __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_add_reverse_edges, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 287, __pyx_L1_error)
26822 :
26823 : /* "scipy/sparse/csgraph/_flow.pyx":367
26824 : *
26825 : *
26826 : * def _make_edge_pointers(a): # <<<<<<<<<<<<<<
26827 : * """Create for each edge pointers to its reverse."""
26828 : * cdef int n = a.shape[0]
26829 : */
26830 3 : __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_a, __pyx_n_s_n, __pyx_n_s_b_data, __pyx_n_s_b); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 367, __pyx_L1_error)
26831 3 : __Pyx_GOTREF(__pyx_tuple__34);
26832 3 : __Pyx_GIVEREF(__pyx_tuple__34);
26833 3 : __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_make_edge_pointers, 367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 367, __pyx_L1_error)
26834 :
26835 : /* "scipy/sparse/csgraph/_flow.pyx":376
26836 : *
26837 : *
26838 : * def _make_tails(a): # <<<<<<<<<<<<<<
26839 : * """Create for each edge pointers to its tail."""
26840 : * cdef int n = a.shape[0]
26841 : */
26842 3 : __pyx_tuple__36 = PyTuple_Pack(6, __pyx_n_s_a, __pyx_n_s_n, __pyx_n_s_tails, __pyx_n_s_a_indptr_view, __pyx_n_s_i, __pyx_n_s_j); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 376, __pyx_L1_error)
26843 3 : __Pyx_GOTREF(__pyx_tuple__36);
26844 3 : __Pyx_GIVEREF(__pyx_tuple__36);
26845 3 : __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_make_tails, 376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 376, __pyx_L1_error)
26846 : __Pyx_RefNannyFinishContext();
26847 : return 0;
26848 : __pyx_L1_error:;
26849 : __Pyx_RefNannyFinishContext();
26850 : return -1;
26851 : }
26852 : /* #### Code section: init_constants ### */
26853 :
26854 3 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
26855 3 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
26856 3 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
26857 3 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26858 3 : __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
26859 3 : __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
26860 3 : __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
26861 3 : __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
26862 3 : __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
26863 3 : __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26864 : return 0;
26865 : __pyx_L1_error:;
26866 : return -1;
26867 : }
26868 : /* #### Code section: init_globals ### */
26869 :
26870 3 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
26871 : /* AssertionsEnabled.init */
26872 3 : if (likely(__Pyx_init_assertions_enabled() == 0)); else
26873 :
26874 0 : if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
26875 :
26876 : return 0;
26877 0 : __pyx_L1_error:;
26878 0 : return -1;
26879 : }
26880 : /* #### Code section: init_module ### */
26881 :
26882 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
26883 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
26884 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
26885 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
26886 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
26887 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
26888 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
26889 :
26890 3 : static int __Pyx_modinit_global_init_code(void) {
26891 : __Pyx_RefNannyDeclarations
26892 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
26893 : /*--- Global init code ---*/
26894 3 : __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
26895 3 : generic = Py_None; Py_INCREF(Py_None);
26896 3 : strided = Py_None; Py_INCREF(Py_None);
26897 3 : indirect = Py_None; Py_INCREF(Py_None);
26898 3 : contiguous = Py_None; Py_INCREF(Py_None);
26899 3 : indirect_contiguous = Py_None; Py_INCREF(Py_None);
26900 3 : __Pyx_RefNannyFinishContext();
26901 3 : return 0;
26902 : }
26903 :
26904 : static int __Pyx_modinit_variable_export_code(void) {
26905 : __Pyx_RefNannyDeclarations
26906 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
26907 : /*--- Variable export code ---*/
26908 : __Pyx_RefNannyFinishContext();
26909 : return 0;
26910 : }
26911 :
26912 : static int __Pyx_modinit_function_export_code(void) {
26913 : __Pyx_RefNannyDeclarations
26914 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
26915 : /*--- Function export code ---*/
26916 : __Pyx_RefNannyFinishContext();
26917 : return 0;
26918 : }
26919 :
26920 3 : static int __Pyx_modinit_type_init_code(void) {
26921 : __Pyx_RefNannyDeclarations
26922 3 : PyObject *__pyx_t_1 = NULL;
26923 3 : int __pyx_lineno = 0;
26924 3 : const char *__pyx_filename = NULL;
26925 3 : int __pyx_clineno = 0;
26926 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
26927 : /*--- Type init code ---*/
26928 3 : __pyx_vtabptr_array = &__pyx_vtable_array;
26929 3 : __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
26930 : #if CYTHON_USE_TYPE_SPECS
26931 : __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(1, 114, __pyx_L1_error)
26932 : #if !CYTHON_COMPILING_IN_LIMITED_API
26933 : __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
26934 : if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26935 : __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
26936 : }
26937 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
26938 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
26939 : #elif defined(_MSC_VER)
26940 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
26941 : #else
26942 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
26943 : #endif
26944 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26945 : #else
26946 3 : __pyx_array_type = &__pyx_type___pyx_array;
26947 : #endif
26948 : #if !CYTHON_COMPILING_IN_LIMITED_API
26949 : #endif
26950 : #if !CYTHON_USE_TYPE_SPECS
26951 3 : if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26952 : #endif
26953 : #if PY_MAJOR_VERSION < 3
26954 : __pyx_array_type->tp_print = 0;
26955 : #endif
26956 3 : if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26957 : #if !CYTHON_COMPILING_IN_LIMITED_API
26958 3 : if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26959 : #endif
26960 : #if !CYTHON_COMPILING_IN_LIMITED_API
26961 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
26962 : #endif
26963 : #if CYTHON_USE_TYPE_SPECS
26964 : __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(1, 302, __pyx_L1_error)
26965 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26966 : #else
26967 3 : __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
26968 : #endif
26969 : #if !CYTHON_COMPILING_IN_LIMITED_API
26970 : #endif
26971 : #if !CYTHON_USE_TYPE_SPECS
26972 3 : if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26973 : #endif
26974 : #if PY_MAJOR_VERSION < 3
26975 : __pyx_MemviewEnum_type->tp_print = 0;
26976 : #endif
26977 : #if !CYTHON_COMPILING_IN_LIMITED_API
26978 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
26979 3 : __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
26980 : }
26981 : #endif
26982 : #if !CYTHON_COMPILING_IN_LIMITED_API
26983 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
26984 : #endif
26985 3 : __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
26986 3 : __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
26987 3 : __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
26988 3 : __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
26989 3 : __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
26990 3 : __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
26991 3 : __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
26992 3 : __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
26993 3 : __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
26994 : #if CYTHON_USE_TYPE_SPECS
26995 : __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(1, 337, __pyx_L1_error)
26996 : #if !CYTHON_COMPILING_IN_LIMITED_API
26997 : __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
26998 : if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
26999 : __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
27000 : }
27001 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
27002 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
27003 : #elif defined(_MSC_VER)
27004 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
27005 : #else
27006 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
27007 : #endif
27008 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27009 : #else
27010 3 : __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27011 : #endif
27012 : #if !CYTHON_COMPILING_IN_LIMITED_API
27013 : #endif
27014 : #if !CYTHON_USE_TYPE_SPECS
27015 3 : if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27016 : #endif
27017 : #if PY_MAJOR_VERSION < 3
27018 : __pyx_memoryview_type->tp_print = 0;
27019 : #endif
27020 : #if !CYTHON_COMPILING_IN_LIMITED_API
27021 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
27022 3 : __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
27023 : }
27024 : #endif
27025 3 : if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27026 : #if !CYTHON_COMPILING_IN_LIMITED_API
27027 3 : if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27028 : #endif
27029 : #if !CYTHON_COMPILING_IN_LIMITED_API
27030 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
27031 : #endif
27032 3 : __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27033 3 : __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27034 3 : __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
27035 3 : __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27036 3 : __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
27037 : #if CYTHON_USE_TYPE_SPECS
27038 : __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
27039 : __Pyx_GOTREF(__pyx_t_1);
27040 : __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
27041 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27042 : if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(1, 952, __pyx_L1_error)
27043 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27044 : #else
27045 3 : __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27046 : #endif
27047 : #if !CYTHON_COMPILING_IN_LIMITED_API
27048 3 : __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
27049 : #endif
27050 : #if !CYTHON_USE_TYPE_SPECS
27051 3 : if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27052 : #endif
27053 : #if PY_MAJOR_VERSION < 3
27054 : __pyx_memoryviewslice_type->tp_print = 0;
27055 : #endif
27056 : #if !CYTHON_COMPILING_IN_LIMITED_API
27057 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
27058 3 : __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
27059 : }
27060 : #endif
27061 3 : if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27062 : #if !CYTHON_COMPILING_IN_LIMITED_API
27063 3 : if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27064 : #endif
27065 : #if !CYTHON_COMPILING_IN_LIMITED_API
27066 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
27067 : #endif
27068 : __Pyx_RefNannyFinishContext();
27069 : return 0;
27070 0 : __pyx_L1_error:;
27071 0 : __Pyx_XDECREF(__pyx_t_1);
27072 0 : __Pyx_RefNannyFinishContext();
27073 0 : return -1;
27074 : }
27075 :
27076 3 : static int __Pyx_modinit_type_import_code(void) {
27077 : __Pyx_RefNannyDeclarations
27078 3 : PyObject *__pyx_t_1 = NULL;
27079 3 : int __pyx_lineno = 0;
27080 3 : const char *__pyx_filename = NULL;
27081 3 : int __pyx_clineno = 0;
27082 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
27083 : /*--- Type import code ---*/
27084 3 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
27085 3 : __Pyx_GOTREF(__pyx_t_1);
27086 3 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
27087 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27088 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
27089 : #elif CYTHON_COMPILING_IN_LIMITED_API
27090 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
27091 : #else
27092 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
27093 : #endif
27094 3 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
27095 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27096 3 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error)
27097 3 : __Pyx_GOTREF(__pyx_t_1);
27098 3 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
27099 3 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
27100 3 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
27101 3 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
27102 3 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
27103 3 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
27104 3 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
27105 3 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
27106 3 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
27107 3 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
27108 3 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
27109 3 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
27110 3 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
27111 3 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
27112 3 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error)
27113 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27114 : __Pyx_RefNannyFinishContext();
27115 : return 0;
27116 0 : __pyx_L1_error:;
27117 0 : __Pyx_XDECREF(__pyx_t_1);
27118 0 : __Pyx_RefNannyFinishContext();
27119 0 : return -1;
27120 : }
27121 :
27122 : static int __Pyx_modinit_variable_import_code(void) {
27123 : __Pyx_RefNannyDeclarations
27124 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
27125 : /*--- Variable import code ---*/
27126 : __Pyx_RefNannyFinishContext();
27127 : return 0;
27128 : }
27129 :
27130 : static int __Pyx_modinit_function_import_code(void) {
27131 : __Pyx_RefNannyDeclarations
27132 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
27133 : /*--- Function import code ---*/
27134 : __Pyx_RefNannyFinishContext();
27135 : return 0;
27136 : }
27137 :
27138 :
27139 : #if PY_MAJOR_VERSION >= 3
27140 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27141 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
27142 : static int __pyx_pymod_exec__flow(PyObject* module); /*proto*/
27143 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
27144 : {Py_mod_create, (void*)__pyx_pymod_create},
27145 : {Py_mod_exec, (void*)__pyx_pymod_exec__flow},
27146 : {0, NULL}
27147 : };
27148 : #endif
27149 :
27150 : #ifdef __cplusplus
27151 : namespace {
27152 : struct PyModuleDef __pyx_moduledef =
27153 : #else
27154 : static struct PyModuleDef __pyx_moduledef =
27155 : #endif
27156 : {
27157 : PyModuleDef_HEAD_INIT,
27158 : "_flow",
27159 : 0, /* m_doc */
27160 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27161 : 0, /* m_size */
27162 : #elif CYTHON_USE_MODULE_STATE
27163 : sizeof(__pyx_mstate), /* m_size */
27164 : #else
27165 : -1, /* m_size */
27166 : #endif
27167 : __pyx_methods /* m_methods */,
27168 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27169 : __pyx_moduledef_slots, /* m_slots */
27170 : #else
27171 : NULL, /* m_reload */
27172 : #endif
27173 : #if CYTHON_USE_MODULE_STATE
27174 : __pyx_m_traverse, /* m_traverse */
27175 : __pyx_m_clear, /* m_clear */
27176 : NULL /* m_free */
27177 : #else
27178 : NULL, /* m_traverse */
27179 : NULL, /* m_clear */
27180 : NULL /* m_free */
27181 : #endif
27182 : };
27183 : #ifdef __cplusplus
27184 : } /* anonymous namespace */
27185 : #endif
27186 : #endif
27187 :
27188 : #ifndef CYTHON_NO_PYINIT_EXPORT
27189 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27190 : #elif PY_MAJOR_VERSION < 3
27191 : #ifdef __cplusplus
27192 : #define __Pyx_PyMODINIT_FUNC extern "C" void
27193 : #else
27194 : #define __Pyx_PyMODINIT_FUNC void
27195 : #endif
27196 : #else
27197 : #ifdef __cplusplus
27198 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
27199 : #else
27200 : #define __Pyx_PyMODINIT_FUNC PyObject *
27201 : #endif
27202 : #endif
27203 :
27204 :
27205 : #if PY_MAJOR_VERSION < 3
27206 : __Pyx_PyMODINIT_FUNC init_flow(void) CYTHON_SMALL_CODE; /*proto*/
27207 : __Pyx_PyMODINIT_FUNC init_flow(void)
27208 : #else
27209 : __Pyx_PyMODINIT_FUNC PyInit__flow(void) CYTHON_SMALL_CODE; /*proto*/
27210 3 : __Pyx_PyMODINIT_FUNC PyInit__flow(void)
27211 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27212 : {
27213 3 : return PyModuleDef_Init(&__pyx_moduledef);
27214 : }
27215 3 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
27216 : #if PY_VERSION_HEX >= 0x030700A1
27217 3 : static PY_INT64_T main_interpreter_id = -1;
27218 3 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27219 3 : if (main_interpreter_id == -1) {
27220 3 : main_interpreter_id = current_id;
27221 6 : return (unlikely(current_id == -1)) ? -1 : 0;
27222 0 : } else if (unlikely(main_interpreter_id != current_id))
27223 : #else
27224 : static PyInterpreterState *main_interpreter = NULL;
27225 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
27226 : if (!main_interpreter) {
27227 : main_interpreter = current_interpreter;
27228 : } else if (unlikely(main_interpreter != current_interpreter))
27229 : #endif
27230 : {
27231 0 : PyErr_SetString(
27232 : PyExc_ImportError,
27233 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27234 0 : return -1;
27235 : }
27236 : return 0;
27237 : }
27238 : #if CYTHON_COMPILING_IN_LIMITED_API
27239 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
27240 : #else
27241 12 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
27242 : #endif
27243 : {
27244 12 : PyObject *value = PyObject_GetAttrString(spec, from_name);
27245 12 : int result = 0;
27246 12 : if (likely(value)) {
27247 12 : if (allow_none || value != Py_None) {
27248 : #if CYTHON_COMPILING_IN_LIMITED_API
27249 : result = PyModule_AddObject(module, to_name, value);
27250 : #else
27251 9 : result = PyDict_SetItemString(moddict, to_name, value);
27252 : #endif
27253 : }
27254 12 : Py_DECREF(value);
27255 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27256 0 : PyErr_Clear();
27257 : } else {
27258 : result = -1;
27259 : }
27260 12 : return result;
27261 : }
27262 3 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
27263 3 : PyObject *module = NULL, *moddict, *modname;
27264 3 : CYTHON_UNUSED_VAR(def);
27265 3 : if (__Pyx_check_single_interpreter())
27266 : return NULL;
27267 3 : if (__pyx_m)
27268 0 : return __Pyx_NewRef(__pyx_m);
27269 3 : modname = PyObject_GetAttrString(spec, "name");
27270 3 : if (unlikely(!modname)) goto bad;
27271 3 : module = PyModule_NewObject(modname);
27272 3 : Py_DECREF(modname);
27273 3 : if (unlikely(!module)) goto bad;
27274 : #if CYTHON_COMPILING_IN_LIMITED_API
27275 : moddict = module;
27276 : #else
27277 3 : moddict = PyModule_GetDict(module);
27278 3 : if (unlikely(!moddict)) goto bad;
27279 : #endif
27280 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27281 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27282 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27283 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27284 : return module;
27285 0 : bad:
27286 0 : Py_XDECREF(module);
27287 0 : return NULL;
27288 : }
27289 :
27290 :
27291 3 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__flow(PyObject *__pyx_pyinit_module)
27292 : #endif
27293 : #endif
27294 : {
27295 3 : int stringtab_initialized = 0;
27296 : #if CYTHON_USE_MODULE_STATE
27297 : int pystate_addmodule_run = 0;
27298 : #endif
27299 3 : PyObject *__pyx_t_1 = NULL;
27300 3 : PyObject *__pyx_t_2 = NULL;
27301 3 : PyObject *__pyx_t_3 = NULL;
27302 3 : PyObject *__pyx_t_4 = NULL;
27303 3 : PyObject *__pyx_t_5 = NULL;
27304 3 : int __pyx_t_6;
27305 3 : PyObject *__pyx_t_7 = NULL;
27306 3 : static PyThread_type_lock __pyx_t_8[8];
27307 3 : int __pyx_t_9;
27308 3 : int __pyx_lineno = 0;
27309 3 : const char *__pyx_filename = NULL;
27310 3 : int __pyx_clineno = 0;
27311 : __Pyx_RefNannyDeclarations
27312 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27313 3 : if (__pyx_m) {
27314 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
27315 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_flow' has already been imported. Re-initialisation is not supported.");
27316 0 : return -1;
27317 : }
27318 : #elif PY_MAJOR_VERSION >= 3
27319 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27320 : #endif
27321 : /*--- Module creation code ---*/
27322 : #if CYTHON_PEP489_MULTI_PHASE_INIT
27323 3 : __pyx_m = __pyx_pyinit_module;
27324 3 : Py_INCREF(__pyx_m);
27325 : #else
27326 : #if PY_MAJOR_VERSION < 3
27327 : __pyx_m = Py_InitModule4("_flow", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27328 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27329 : #elif CYTHON_USE_MODULE_STATE
27330 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27331 : {
27332 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
27333 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_flow" pseudovariable */
27334 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27335 : pystate_addmodule_run = 1;
27336 : }
27337 : #else
27338 : __pyx_m = PyModule_Create(&__pyx_moduledef);
27339 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27340 : #endif
27341 : #endif
27342 3 : CYTHON_UNUSED_VAR(__pyx_t_1);
27343 3 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27344 3 : Py_INCREF(__pyx_d);
27345 3 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27346 3 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27347 3 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27348 : #if CYTHON_REFNANNY
27349 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27350 : if (!__Pyx_RefNanny) {
27351 : PyErr_Clear();
27352 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27353 : if (!__Pyx_RefNanny)
27354 : Py_FatalError("failed to import 'refnanny' module");
27355 : }
27356 : #endif
27357 3 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__flow(void)", 0);
27358 3 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27359 : #ifdef __Pxy_PyFrame_Initialize_Offsets
27360 : __Pxy_PyFrame_Initialize_Offsets();
27361 : #endif
27362 3 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27363 3 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27364 3 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27365 : #ifdef __Pyx_CyFunction_USED
27366 3 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27367 : #endif
27368 : #ifdef __Pyx_FusedFunction_USED
27369 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27370 : #endif
27371 : #ifdef __Pyx_Coroutine_USED
27372 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27373 : #endif
27374 : #ifdef __Pyx_Generator_USED
27375 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27376 : #endif
27377 : #ifdef __Pyx_AsyncGen_USED
27378 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27379 : #endif
27380 : #ifdef __Pyx_StopAsyncIteration_USED
27381 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27382 : #endif
27383 : /*--- Library function declarations ---*/
27384 : /*--- Threads initialization code ---*/
27385 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27386 : PyEval_InitThreads();
27387 : #endif
27388 : /*--- Initialize various global constants etc. ---*/
27389 3 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27390 3 : stringtab_initialized = 1;
27391 3 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27392 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27393 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27394 : #endif
27395 3 : if (__pyx_module_is_main_scipy__sparse__csgraph___flow) {
27396 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27397 : }
27398 : #if PY_MAJOR_VERSION >= 3
27399 : {
27400 3 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27401 3 : if (!PyDict_GetItemString(modules, "scipy.sparse.csgraph._flow")) {
27402 0 : if (unlikely((PyDict_SetItemString(modules, "scipy.sparse.csgraph._flow", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27403 : }
27404 : }
27405 : #endif
27406 : /*--- Builtin init code ---*/
27407 3 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27408 : /*--- Constants init code ---*/
27409 3 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27410 : /*--- Global type/function init code ---*/
27411 3 : (void)__Pyx_modinit_global_init_code();
27412 3 : (void)__Pyx_modinit_variable_export_code();
27413 3 : (void)__Pyx_modinit_function_export_code();
27414 3 : if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27415 3 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
27416 3 : (void)__Pyx_modinit_variable_import_code();
27417 3 : (void)__Pyx_modinit_function_import_code();
27418 : /*--- Execution code ---*/
27419 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27420 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27421 : #endif
27422 :
27423 : /* "View.MemoryView":99
27424 : *
27425 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27426 : * try: # <<<<<<<<<<<<<<
27427 : * if __import__("sys").version_info >= (3, 3):
27428 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27429 : */
27430 : {
27431 3 : __Pyx_PyThreadState_declare
27432 3 : __Pyx_PyThreadState_assign
27433 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27434 3 : __Pyx_XGOTREF(__pyx_t_1);
27435 3 : __Pyx_XGOTREF(__pyx_t_2);
27436 3 : __Pyx_XGOTREF(__pyx_t_3);
27437 : /*try:*/ {
27438 :
27439 : /* "View.MemoryView":100
27440 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27441 : * try:
27442 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27443 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27444 : * else:
27445 : */
27446 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27447 3 : __Pyx_GOTREF(__pyx_t_4);
27448 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L2_error)
27449 3 : __Pyx_GOTREF(__pyx_t_5);
27450 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27451 3 : __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__16, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
27452 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27453 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 100, __pyx_L2_error)
27454 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27455 3 : if (__pyx_t_6) {
27456 :
27457 : /* "View.MemoryView":101
27458 : * try:
27459 : * if __import__("sys").version_info >= (3, 3):
27460 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
27461 : * else:
27462 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27463 : */
27464 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27465 3 : __Pyx_GOTREF(__pyx_t_4);
27466 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L2_error)
27467 3 : __Pyx_GOTREF(__pyx_t_5);
27468 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27469 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
27470 3 : __Pyx_GOTREF(__pyx_t_4);
27471 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27472 3 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27473 3 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
27474 3 : __Pyx_GIVEREF(__pyx_t_4);
27475 3 : __pyx_t_4 = 0;
27476 :
27477 : /* "View.MemoryView":100
27478 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27479 : * try:
27480 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
27481 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27482 : * else:
27483 : */
27484 3 : goto __pyx_L8;
27485 : }
27486 :
27487 : /* "View.MemoryView":103
27488 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27489 : * else:
27490 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
27491 : * except:
27492 : *
27493 : */
27494 : /*else*/ {
27495 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L2_error)
27496 0 : __Pyx_GOTREF(__pyx_t_4);
27497 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L2_error)
27498 0 : __Pyx_GOTREF(__pyx_t_5);
27499 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27500 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27501 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5);
27502 0 : __Pyx_GIVEREF(__pyx_t_5);
27503 0 : __pyx_t_5 = 0;
27504 : }
27505 3 : __pyx_L8:;
27506 :
27507 : /* "View.MemoryView":99
27508 : *
27509 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27510 : * try: # <<<<<<<<<<<<<<
27511 : * if __import__("sys").version_info >= (3, 3):
27512 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27513 : */
27514 : }
27515 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27516 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27517 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27518 3 : goto __pyx_L7_try_end;
27519 0 : __pyx_L2_error:;
27520 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27521 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27522 :
27523 : /* "View.MemoryView":104
27524 : * else:
27525 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
27526 : * except: # <<<<<<<<<<<<<<
27527 : *
27528 : * __pyx_collections_abc_Sequence = None
27529 : */
27530 : /*except:*/ {
27531 0 : __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
27532 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 104, __pyx_L4_except_error)
27533 0 : __Pyx_XGOTREF(__pyx_t_5);
27534 0 : __Pyx_XGOTREF(__pyx_t_4);
27535 0 : __Pyx_XGOTREF(__pyx_t_7);
27536 :
27537 : /* "View.MemoryView":106
27538 : * except:
27539 : *
27540 : * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
27541 : *
27542 : *
27543 : */
27544 0 : __Pyx_INCREF(Py_None);
27545 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
27546 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
27547 0 : __Pyx_GIVEREF(Py_None);
27548 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27549 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27550 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27551 0 : goto __pyx_L3_exception_handled;
27552 : }
27553 :
27554 : /* "View.MemoryView":99
27555 : *
27556 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
27557 : * try: # <<<<<<<<<<<<<<
27558 : * if __import__("sys").version_info >= (3, 3):
27559 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
27560 : */
27561 0 : __pyx_L4_except_error:;
27562 0 : __Pyx_XGIVEREF(__pyx_t_1);
27563 0 : __Pyx_XGIVEREF(__pyx_t_2);
27564 0 : __Pyx_XGIVEREF(__pyx_t_3);
27565 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27566 0 : goto __pyx_L1_error;
27567 0 : __pyx_L3_exception_handled:;
27568 0 : __Pyx_XGIVEREF(__pyx_t_1);
27569 0 : __Pyx_XGIVEREF(__pyx_t_2);
27570 0 : __Pyx_XGIVEREF(__pyx_t_3);
27571 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27572 3 : __pyx_L7_try_end:;
27573 : }
27574 :
27575 : /* "View.MemoryView":241
27576 : *
27577 : *
27578 : * try: # <<<<<<<<<<<<<<
27579 : * count = __pyx_collections_abc_Sequence.count
27580 : * index = __pyx_collections_abc_Sequence.index
27581 : */
27582 : {
27583 3 : __Pyx_PyThreadState_declare
27584 3 : __Pyx_PyThreadState_assign
27585 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27586 3 : __Pyx_XGOTREF(__pyx_t_3);
27587 3 : __Pyx_XGOTREF(__pyx_t_2);
27588 3 : __Pyx_XGOTREF(__pyx_t_1);
27589 : /*try:*/ {
27590 :
27591 : /* "View.MemoryView":242
27592 : *
27593 : * try:
27594 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27595 : * index = __pyx_collections_abc_Sequence.index
27596 : * except:
27597 : */
27598 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L11_error)
27599 3 : __Pyx_GOTREF(__pyx_t_7);
27600 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 242, __pyx_L11_error)
27601 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27602 3 : PyType_Modified(__pyx_array_type);
27603 :
27604 : /* "View.MemoryView":243
27605 : * try:
27606 : * count = __pyx_collections_abc_Sequence.count
27607 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27608 : * except:
27609 : * pass
27610 : */
27611 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 243, __pyx_L11_error)
27612 3 : __Pyx_GOTREF(__pyx_t_7);
27613 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 243, __pyx_L11_error)
27614 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27615 3 : PyType_Modified(__pyx_array_type);
27616 :
27617 : /* "View.MemoryView":241
27618 : *
27619 : *
27620 : * try: # <<<<<<<<<<<<<<
27621 : * count = __pyx_collections_abc_Sequence.count
27622 : * index = __pyx_collections_abc_Sequence.index
27623 : */
27624 : }
27625 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27626 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27627 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27628 3 : goto __pyx_L16_try_end;
27629 0 : __pyx_L11_error:;
27630 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27631 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27632 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27633 :
27634 : /* "View.MemoryView":244
27635 : * count = __pyx_collections_abc_Sequence.count
27636 : * index = __pyx_collections_abc_Sequence.index
27637 : * except: # <<<<<<<<<<<<<<
27638 : * pass
27639 : *
27640 : */
27641 : /*except:*/ {
27642 0 : __Pyx_ErrRestore(0,0,0);
27643 0 : goto __pyx_L12_exception_handled;
27644 : }
27645 0 : __pyx_L12_exception_handled:;
27646 0 : __Pyx_XGIVEREF(__pyx_t_3);
27647 0 : __Pyx_XGIVEREF(__pyx_t_2);
27648 0 : __Pyx_XGIVEREF(__pyx_t_1);
27649 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27650 3 : __pyx_L16_try_end:;
27651 : }
27652 :
27653 : /* "View.MemoryView":309
27654 : * return self.name
27655 : *
27656 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
27657 : * cdef strided = Enum("<strided and direct>") # default
27658 : * cdef indirect = Enum("<strided and indirect>")
27659 : */
27660 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 309, __pyx_L1_error)
27661 3 : __Pyx_GOTREF(__pyx_t_7);
27662 3 : __Pyx_XGOTREF(generic);
27663 3 : __Pyx_DECREF_SET(generic, __pyx_t_7);
27664 3 : __Pyx_GIVEREF(__pyx_t_7);
27665 3 : __pyx_t_7 = 0;
27666 :
27667 : /* "View.MemoryView":310
27668 : *
27669 : * cdef generic = Enum("<strided and direct or indirect>")
27670 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
27671 : * cdef indirect = Enum("<strided and indirect>")
27672 : *
27673 : */
27674 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
27675 3 : __Pyx_GOTREF(__pyx_t_7);
27676 3 : __Pyx_XGOTREF(strided);
27677 3 : __Pyx_DECREF_SET(strided, __pyx_t_7);
27678 3 : __Pyx_GIVEREF(__pyx_t_7);
27679 3 : __pyx_t_7 = 0;
27680 :
27681 : /* "View.MemoryView":311
27682 : * cdef generic = Enum("<strided and direct or indirect>")
27683 : * cdef strided = Enum("<strided and direct>") # default
27684 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
27685 : *
27686 : *
27687 : */
27688 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 311, __pyx_L1_error)
27689 3 : __Pyx_GOTREF(__pyx_t_7);
27690 3 : __Pyx_XGOTREF(indirect);
27691 3 : __Pyx_DECREF_SET(indirect, __pyx_t_7);
27692 3 : __Pyx_GIVEREF(__pyx_t_7);
27693 3 : __pyx_t_7 = 0;
27694 :
27695 : /* "View.MemoryView":314
27696 : *
27697 : *
27698 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
27699 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27700 : *
27701 : */
27702 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 314, __pyx_L1_error)
27703 3 : __Pyx_GOTREF(__pyx_t_7);
27704 3 : __Pyx_XGOTREF(contiguous);
27705 3 : __Pyx_DECREF_SET(contiguous, __pyx_t_7);
27706 3 : __Pyx_GIVEREF(__pyx_t_7);
27707 3 : __pyx_t_7 = 0;
27708 :
27709 : /* "View.MemoryView":315
27710 : *
27711 : * cdef contiguous = Enum("<contiguous and direct>")
27712 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
27713 : *
27714 : *
27715 : */
27716 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 315, __pyx_L1_error)
27717 3 : __Pyx_GOTREF(__pyx_t_7);
27718 3 : __Pyx_XGOTREF(indirect_contiguous);
27719 3 : __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
27720 3 : __Pyx_GIVEREF(__pyx_t_7);
27721 3 : __pyx_t_7 = 0;
27722 :
27723 : /* "View.MemoryView":323
27724 : *
27725 : *
27726 : * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
27727 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
27728 : * PyThread_allocate_lock(),
27729 : */
27730 3 : __pyx_memoryview_thread_locks_used = 0;
27731 :
27732 : /* "View.MemoryView":324
27733 : *
27734 : * cdef int __pyx_memoryview_thread_locks_used = 0
27735 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
27736 : * PyThread_allocate_lock(),
27737 : * PyThread_allocate_lock(),
27738 : */
27739 3 : __pyx_t_8[0] = PyThread_allocate_lock();
27740 3 : __pyx_t_8[1] = PyThread_allocate_lock();
27741 3 : __pyx_t_8[2] = PyThread_allocate_lock();
27742 3 : __pyx_t_8[3] = PyThread_allocate_lock();
27743 3 : __pyx_t_8[4] = PyThread_allocate_lock();
27744 3 : __pyx_t_8[5] = PyThread_allocate_lock();
27745 3 : __pyx_t_8[6] = PyThread_allocate_lock();
27746 3 : __pyx_t_8[7] = PyThread_allocate_lock();
27747 3 : memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27748 :
27749 : /* "View.MemoryView":982
27750 : *
27751 : *
27752 : * try: # <<<<<<<<<<<<<<
27753 : * count = __pyx_collections_abc_Sequence.count
27754 : * index = __pyx_collections_abc_Sequence.index
27755 : */
27756 : {
27757 3 : __Pyx_PyThreadState_declare
27758 3 : __Pyx_PyThreadState_assign
27759 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
27760 3 : __Pyx_XGOTREF(__pyx_t_1);
27761 3 : __Pyx_XGOTREF(__pyx_t_2);
27762 3 : __Pyx_XGOTREF(__pyx_t_3);
27763 : /*try:*/ {
27764 :
27765 : /* "View.MemoryView":983
27766 : *
27767 : * try:
27768 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
27769 : * index = __pyx_collections_abc_Sequence.index
27770 : * except:
27771 : */
27772 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 983, __pyx_L17_error)
27773 3 : __Pyx_GOTREF(__pyx_t_7);
27774 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L17_error)
27775 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27776 3 : PyType_Modified(__pyx_memoryviewslice_type);
27777 :
27778 : /* "View.MemoryView":984
27779 : * try:
27780 : * count = __pyx_collections_abc_Sequence.count
27781 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
27782 : * except:
27783 : * pass
27784 : */
27785 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 984, __pyx_L17_error)
27786 3 : __Pyx_GOTREF(__pyx_t_7);
27787 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 984, __pyx_L17_error)
27788 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27789 3 : PyType_Modified(__pyx_memoryviewslice_type);
27790 :
27791 : /* "View.MemoryView":982
27792 : *
27793 : *
27794 : * try: # <<<<<<<<<<<<<<
27795 : * count = __pyx_collections_abc_Sequence.count
27796 : * index = __pyx_collections_abc_Sequence.index
27797 : */
27798 : }
27799 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27800 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27801 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27802 3 : goto __pyx_L22_try_end;
27803 0 : __pyx_L17_error:;
27804 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27805 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27806 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27807 :
27808 : /* "View.MemoryView":985
27809 : * count = __pyx_collections_abc_Sequence.count
27810 : * index = __pyx_collections_abc_Sequence.index
27811 : * except: # <<<<<<<<<<<<<<
27812 : * pass
27813 : *
27814 : */
27815 : /*except:*/ {
27816 0 : __Pyx_ErrRestore(0,0,0);
27817 0 : goto __pyx_L18_exception_handled;
27818 : }
27819 0 : __pyx_L18_exception_handled:;
27820 0 : __Pyx_XGIVEREF(__pyx_t_1);
27821 0 : __Pyx_XGIVEREF(__pyx_t_2);
27822 0 : __Pyx_XGIVEREF(__pyx_t_3);
27823 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
27824 3 : __pyx_L22_try_end:;
27825 : }
27826 :
27827 : /* "View.MemoryView":988
27828 : * pass
27829 : *
27830 : * try: # <<<<<<<<<<<<<<
27831 : * if __pyx_collections_abc_Sequence:
27832 : *
27833 : */
27834 : {
27835 3 : __Pyx_PyThreadState_declare
27836 3 : __Pyx_PyThreadState_assign
27837 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
27838 3 : __Pyx_XGOTREF(__pyx_t_3);
27839 3 : __Pyx_XGOTREF(__pyx_t_2);
27840 3 : __Pyx_XGOTREF(__pyx_t_1);
27841 : /*try:*/ {
27842 :
27843 : /* "View.MemoryView":989
27844 : *
27845 : * try:
27846 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27847 : *
27848 : *
27849 : */
27850 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 989, __pyx_L23_error)
27851 3 : if (__pyx_t_6) {
27852 :
27853 : /* "View.MemoryView":993
27854 : *
27855 : *
27856 : * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
27857 : * __pyx_collections_abc_Sequence.register(array)
27858 : * except:
27859 : */
27860 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 993, __pyx_L23_error)
27861 3 : __Pyx_GOTREF(__pyx_t_7);
27862 3 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 993, __pyx_L23_error)
27863 3 : __Pyx_GOTREF(__pyx_t_4);
27864 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27865 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27866 :
27867 : /* "View.MemoryView":994
27868 : *
27869 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27870 : * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
27871 : * except:
27872 : * pass # ignore failure, it's a minor issue
27873 : */
27874 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 994, __pyx_L23_error)
27875 3 : __Pyx_GOTREF(__pyx_t_4);
27876 3 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 994, __pyx_L23_error)
27877 3 : __Pyx_GOTREF(__pyx_t_7);
27878 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27879 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27880 :
27881 : /* "View.MemoryView":989
27882 : *
27883 : * try:
27884 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
27885 : *
27886 : *
27887 : */
27888 : }
27889 :
27890 : /* "View.MemoryView":988
27891 : * pass
27892 : *
27893 : * try: # <<<<<<<<<<<<<<
27894 : * if __pyx_collections_abc_Sequence:
27895 : *
27896 : */
27897 : }
27898 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27899 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27900 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27901 3 : goto __pyx_L28_try_end;
27902 0 : __pyx_L23_error:;
27903 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27904 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27905 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27906 :
27907 : /* "View.MemoryView":995
27908 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
27909 : * __pyx_collections_abc_Sequence.register(array)
27910 : * except: # <<<<<<<<<<<<<<
27911 : * pass # ignore failure, it's a minor issue
27912 : *
27913 : */
27914 : /*except:*/ {
27915 0 : __Pyx_ErrRestore(0,0,0);
27916 0 : goto __pyx_L24_exception_handled;
27917 : }
27918 0 : __pyx_L24_exception_handled:;
27919 0 : __Pyx_XGIVEREF(__pyx_t_3);
27920 0 : __Pyx_XGIVEREF(__pyx_t_2);
27921 0 : __Pyx_XGIVEREF(__pyx_t_1);
27922 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
27923 3 : __pyx_L28_try_end:;
27924 : }
27925 :
27926 : /* "(tree fragment)":1
27927 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
27928 : * cdef object __pyx_PickleError
27929 : * cdef object __pyx_result
27930 : */
27931 3 : __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
27932 3 : __Pyx_GOTREF(__pyx_t_7);
27933 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
27934 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27935 :
27936 : /* "scipy/sparse/csgraph/_flow.pyx":3
27937 : * # cython: wraparound=False, boundscheck=False
27938 : *
27939 : * import numpy as np # <<<<<<<<<<<<<<
27940 : *
27941 : * from scipy.sparse import csr_array, issparse, csr_matrix
27942 : */
27943 3 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3, __pyx_L1_error)
27944 3 : __Pyx_GOTREF(__pyx_t_7);
27945 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
27946 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27947 :
27948 : /* "scipy/sparse/csgraph/_flow.pyx":5
27949 : * import numpy as np
27950 : *
27951 : * from scipy.sparse import csr_array, issparse, csr_matrix # <<<<<<<<<<<<<<
27952 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy, is_pydata_spmatrix
27953 : *
27954 : */
27955 3 : __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
27956 3 : __Pyx_GOTREF(__pyx_t_7);
27957 3 : __Pyx_INCREF(__pyx_n_s_csr_array);
27958 3 : __Pyx_GIVEREF(__pyx_n_s_csr_array);
27959 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_csr_array)) __PYX_ERR(0, 5, __pyx_L1_error);
27960 3 : __Pyx_INCREF(__pyx_n_s_issparse);
27961 3 : __Pyx_GIVEREF(__pyx_n_s_issparse);
27962 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_issparse)) __PYX_ERR(0, 5, __pyx_L1_error);
27963 3 : __Pyx_INCREF(__pyx_n_s_csr_matrix);
27964 3 : __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
27965 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_csr_matrix)) __PYX_ERR(0, 5, __pyx_L1_error);
27966 3 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
27967 3 : __Pyx_GOTREF(__pyx_t_4);
27968 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27969 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_csr_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
27970 3 : __Pyx_GOTREF(__pyx_t_7);
27971 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_array, __pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
27972 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27973 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_issparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
27974 3 : __Pyx_GOTREF(__pyx_t_7);
27975 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
27976 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27977 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)
27978 3 : __Pyx_GOTREF(__pyx_t_7);
27979 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
27980 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27981 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27982 :
27983 : /* "scipy/sparse/csgraph/_flow.pyx":6
27984 : *
27985 : * from scipy.sparse import csr_array, issparse, csr_matrix
27986 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy, is_pydata_spmatrix # <<<<<<<<<<<<<<
27987 : *
27988 : * from ._tools import _safe_downcast_indices
27989 : */
27990 3 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
27991 3 : __Pyx_GOTREF(__pyx_t_4);
27992 3 : __Pyx_INCREF(__pyx_n_s_convert_pydata_sparse_to_scipy);
27993 3 : __Pyx_GIVEREF(__pyx_n_s_convert_pydata_sparse_to_scipy);
27994 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_convert_pydata_sparse_to_scipy)) __PYX_ERR(0, 6, __pyx_L1_error);
27995 3 : __Pyx_INCREF(__pyx_n_s_is_pydata_spmatrix);
27996 3 : __Pyx_GIVEREF(__pyx_n_s_is_pydata_spmatrix);
27997 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_is_pydata_spmatrix)) __PYX_ERR(0, 6, __pyx_L1_error);
27998 3 : __pyx_t_7 = __Pyx_Import(__pyx_n_s_scipy_sparse__sputils, __pyx_t_4, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6, __pyx_L1_error)
27999 3 : __Pyx_GOTREF(__pyx_t_7);
28000 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28001 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_convert_pydata_sparse_to_scipy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
28002 3 : __Pyx_GOTREF(__pyx_t_4);
28003 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_convert_pydata_sparse_to_scipy, __pyx_t_4) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
28004 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28005 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_is_pydata_spmatrix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
28006 3 : __Pyx_GOTREF(__pyx_t_4);
28007 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_pydata_spmatrix, __pyx_t_4) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
28008 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28009 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28010 :
28011 : /* "scipy/sparse/csgraph/_flow.pyx":8
28012 : * from scipy.sparse._sputils import convert_pydata_sparse_to_scipy, is_pydata_spmatrix
28013 : *
28014 : * from ._tools import _safe_downcast_indices # <<<<<<<<<<<<<<
28015 : *
28016 : * cimport numpy as np
28017 : */
28018 3 : __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 8, __pyx_L1_error)
28019 3 : __Pyx_GOTREF(__pyx_t_7);
28020 3 : __Pyx_INCREF(__pyx_n_s_safe_downcast_indices);
28021 3 : __Pyx_GIVEREF(__pyx_n_s_safe_downcast_indices);
28022 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_safe_downcast_indices)) __PYX_ERR(0, 8, __pyx_L1_error);
28023 3 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_tools, __pyx_t_7, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
28024 3 : __Pyx_GOTREF(__pyx_t_4);
28025 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28026 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_safe_downcast_indices); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 8, __pyx_L1_error)
28027 3 : __Pyx_GOTREF(__pyx_t_7);
28028 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_downcast_indices, __pyx_t_7) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
28029 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28030 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28031 :
28032 : /* "../scipy/sparse/csgraph/parameters.pxi":2
28033 : *
28034 : * DTYPE = np.float64 # <<<<<<<<<<<<<<
28035 : * ctypedef np.float64_t DTYPE_t
28036 : *
28037 : */
28038 3 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2, __pyx_L1_error)
28039 3 : __Pyx_GOTREF(__pyx_t_4);
28040 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 2, __pyx_L1_error)
28041 3 : __Pyx_GOTREF(__pyx_t_7);
28042 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28043 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_7) < 0) __PYX_ERR(4, 2, __pyx_L1_error)
28044 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28045 :
28046 : /* "../scipy/sparse/csgraph/parameters.pxi":5
28047 : * ctypedef np.float64_t DTYPE_t
28048 : *
28049 : * ITYPE = np.int32 # <<<<<<<<<<<<<<
28050 : * ctypedef np.int32_t ITYPE_t
28051 : *
28052 : */
28053 3 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 5, __pyx_L1_error)
28054 3 : __Pyx_GOTREF(__pyx_t_7);
28055 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
28056 3 : __Pyx_GOTREF(__pyx_t_4);
28057 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28058 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_ITYPE, __pyx_t_4) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
28059 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28060 :
28061 : /* "scipy/sparse/csgraph/_flow.pyx":14
28062 : * include 'parameters.pxi'
28063 : *
28064 : * np.import_array() # <<<<<<<<<<<<<<
28065 : *
28066 : *
28067 : */
28068 3 : __pyx_t_9 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 14, __pyx_L1_error)
28069 :
28070 : /* "scipy/sparse/csgraph/_flow.pyx":17
28071 : *
28072 : *
28073 : * class MaximumFlowResult: # <<<<<<<<<<<<<<
28074 : * """Represents the result of a maximum flow calculation.
28075 : *
28076 : */
28077 3 : __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_MaximumFlowResult, __pyx_n_s_MaximumFlowResult, (PyObject *) NULL, __pyx_n_s_scipy_sparse_csgraph__flow, __pyx_kp_s_Represents_the_result_of_a_maxim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error)
28078 3 : __Pyx_GOTREF(__pyx_t_4);
28079 :
28080 : /* "scipy/sparse/csgraph/_flow.pyx":28
28081 : * """
28082 : *
28083 : * def __init__(self, flow_value, flow): # <<<<<<<<<<<<<<
28084 : * self.flow_value = flow_value
28085 : * self.flow = flow
28086 : */
28087 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_1__init__, 0, __pyx_n_s_MaximumFlowResult___init, NULL, __pyx_n_s_scipy_sparse_csgraph__flow, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
28088 3 : __Pyx_GOTREF(__pyx_t_7);
28089 3 : if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
28090 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28091 :
28092 : /* "scipy/sparse/csgraph/_flow.pyx":32
28093 : * self.flow = flow
28094 : *
28095 : * def __repr__(self): # <<<<<<<<<<<<<<
28096 : * return 'MaximumFlowResult with value of %d' % self.flow_value
28097 : *
28098 : */
28099 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_5_flow_17MaximumFlowResult_3__repr__, 0, __pyx_n_s_MaximumFlowResult___repr, NULL, __pyx_n_s_scipy_sparse_csgraph__flow, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
28100 3 : __Pyx_GOTREF(__pyx_t_7);
28101 3 : if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
28102 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28103 :
28104 : /* "scipy/sparse/csgraph/_flow.pyx":17
28105 : *
28106 : *
28107 : * class MaximumFlowResult: # <<<<<<<<<<<<<<
28108 : * """Represents the result of a maximum flow calculation.
28109 : *
28110 : */
28111 3 : __pyx_t_7 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_MaximumFlowResult, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 17, __pyx_L1_error)
28112 3 : __Pyx_GOTREF(__pyx_t_7);
28113 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_MaximumFlowResult, __pyx_t_7) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
28114 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28115 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28116 :
28117 : /* "scipy/sparse/csgraph/_flow.pyx":36
28118 : *
28119 : *
28120 : * def maximum_flow(csgraph, source, sink, *, method='dinic'): # <<<<<<<<<<<<<<
28121 : * r"""
28122 : * maximum_flow(csgraph, source, sink)
28123 : */
28124 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
28125 3 : __Pyx_GOTREF(__pyx_t_4);
28126 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_method, ((PyObject*)__pyx_n_u_dinic)) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
28127 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_5_flow_1maximum_flow, 0, __pyx_n_s_maximum_flow, NULL, __pyx_n_s_scipy_sparse_csgraph__flow, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error)
28128 3 : __Pyx_GOTREF(__pyx_t_7);
28129 6 : __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_4);
28130 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28131 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_maximum_flow, __pyx_t_7) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
28132 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28133 :
28134 : /* "scipy/sparse/csgraph/_flow.pyx":287
28135 : *
28136 : *
28137 : * def _add_reverse_edges(a): # <<<<<<<<<<<<<<
28138 : * """Add reversed edges to all edges in a graph.
28139 : *
28140 : */
28141 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_5_flow_3_add_reverse_edges, 0, __pyx_n_s_add_reverse_edges, NULL, __pyx_n_s_scipy_sparse_csgraph__flow, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
28142 3 : __Pyx_GOTREF(__pyx_t_7);
28143 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_reverse_edges, __pyx_t_7) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
28144 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28145 :
28146 : /* "scipy/sparse/csgraph/_flow.pyx":367
28147 : *
28148 : *
28149 : * def _make_edge_pointers(a): # <<<<<<<<<<<<<<
28150 : * """Create for each edge pointers to its reverse."""
28151 : * cdef int n = a.shape[0]
28152 : */
28153 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_5_flow_5_make_edge_pointers, 0, __pyx_n_s_make_edge_pointers, NULL, __pyx_n_s_scipy_sparse_csgraph__flow, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
28154 3 : __Pyx_GOTREF(__pyx_t_7);
28155 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_edge_pointers, __pyx_t_7) < 0) __PYX_ERR(0, 367, __pyx_L1_error)
28156 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28157 :
28158 : /* "scipy/sparse/csgraph/_flow.pyx":376
28159 : *
28160 : *
28161 : * def _make_tails(a): # <<<<<<<<<<<<<<
28162 : * """Create for each edge pointers to its tail."""
28163 : * cdef int n = a.shape[0]
28164 : */
28165 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6sparse_7csgraph_5_flow_7_make_tails, 0, __pyx_n_s_make_tails, NULL, __pyx_n_s_scipy_sparse_csgraph__flow, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error)
28166 3 : __Pyx_GOTREF(__pyx_t_7);
28167 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_tails, __pyx_t_7) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
28168 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28169 :
28170 : /* "scipy/sparse/csgraph/_flow.pyx":1
28171 : * # cython: wraparound=False, boundscheck=False # <<<<<<<<<<<<<<
28172 : *
28173 : * import numpy as np
28174 : */
28175 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
28176 3 : __Pyx_GOTREF(__pyx_t_7);
28177 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_maximum_flow_line_36, __pyx_kp_u_maximum_flow_csgraph_source_sin) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28178 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28179 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28180 :
28181 : /*--- Wrapped vars code ---*/
28182 :
28183 3 : goto __pyx_L0;
28184 0 : __pyx_L1_error:;
28185 0 : __Pyx_XDECREF(__pyx_t_4);
28186 0 : __Pyx_XDECREF(__pyx_t_5);
28187 0 : __Pyx_XDECREF(__pyx_t_7);
28188 0 : if (__pyx_m) {
28189 0 : if (__pyx_d && stringtab_initialized) {
28190 0 : __Pyx_AddTraceback("init scipy.sparse.csgraph._flow", __pyx_clineno, __pyx_lineno, __pyx_filename);
28191 : }
28192 : #if !CYTHON_USE_MODULE_STATE
28193 0 : Py_CLEAR(__pyx_m);
28194 : #else
28195 : Py_DECREF(__pyx_m);
28196 : if (pystate_addmodule_run) {
28197 : PyObject *tp, *value, *tb;
28198 : PyErr_Fetch(&tp, &value, &tb);
28199 : PyState_RemoveModule(&__pyx_moduledef);
28200 : PyErr_Restore(tp, value, tb);
28201 : }
28202 : #endif
28203 0 : } else if (!PyErr_Occurred()) {
28204 0 : PyErr_SetString(PyExc_ImportError, "init scipy.sparse.csgraph._flow");
28205 : }
28206 0 : __pyx_L0:;
28207 3 : __Pyx_RefNannyFinishContext();
28208 : #if CYTHON_PEP489_MULTI_PHASE_INIT
28209 3 : return (__pyx_m != NULL) ? 0 : -1;
28210 : #elif PY_MAJOR_VERSION >= 3
28211 : return __pyx_m;
28212 : #else
28213 : return;
28214 : #endif
28215 : }
28216 : /* #### Code section: cleanup_globals ### */
28217 : /* #### Code section: cleanup_module ### */
28218 : /* #### Code section: main_method ### */
28219 : /* #### Code section: utility_code_pragmas ### */
28220 : #ifdef _MSC_VER
28221 : #pragma warning( push )
28222 : /* Warning 4127: conditional expression is constant
28223 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
28224 : * compile-time, so this warning is not useful
28225 : */
28226 : #pragma warning( disable : 4127 )
28227 : #endif
28228 :
28229 :
28230 :
28231 : /* #### Code section: utility_code_def ### */
28232 :
28233 : /* --- Runtime support code --- */
28234 : /* Refnanny */
28235 : #if CYTHON_REFNANNY
28236 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
28237 : PyObject *m = NULL, *p = NULL;
28238 : void *r = NULL;
28239 : m = PyImport_ImportModule(modname);
28240 : if (!m) goto end;
28241 : p = PyObject_GetAttrString(m, "RefNannyAPI");
28242 : if (!p) goto end;
28243 : r = PyLong_AsVoidPtr(p);
28244 : end:
28245 : Py_XDECREF(p);
28246 : Py_XDECREF(m);
28247 : return (__Pyx_RefNannyAPIStruct *)r;
28248 : }
28249 : #endif
28250 :
28251 : /* PyErrExceptionMatches */
28252 : #if CYTHON_FAST_THREAD_STATE
28253 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28254 0 : Py_ssize_t i, n;
28255 0 : n = PyTuple_GET_SIZE(tuple);
28256 : #if PY_MAJOR_VERSION >= 3
28257 0 : for (i=0; i<n; i++) {
28258 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28259 : }
28260 : #endif
28261 0 : for (i=0; i<n; i++) {
28262 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
28263 : }
28264 : return 0;
28265 : }
28266 9 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
28267 9 : int result;
28268 9 : PyObject *exc_type;
28269 : #if PY_VERSION_HEX >= 0x030C00A6
28270 9 : PyObject *current_exception = tstate->current_exception;
28271 9 : if (unlikely(!current_exception)) return 0;
28272 9 : exc_type = (PyObject*) Py_TYPE(current_exception);
28273 9 : if (exc_type == err) return 1;
28274 : #else
28275 : exc_type = tstate->curexc_type;
28276 : if (exc_type == err) return 1;
28277 : if (unlikely(!exc_type)) return 0;
28278 : #endif
28279 : #if CYTHON_AVOID_BORROWED_REFS
28280 : Py_INCREF(exc_type);
28281 : #endif
28282 0 : if (unlikely(PyTuple_Check(err))) {
28283 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
28284 : } else {
28285 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
28286 : }
28287 : #if CYTHON_AVOID_BORROWED_REFS
28288 : Py_DECREF(exc_type);
28289 : #endif
28290 : return result;
28291 : }
28292 : #endif
28293 :
28294 : /* PyErrFetchRestore */
28295 : #if CYTHON_FAST_THREAD_STATE
28296 32 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28297 : #if PY_VERSION_HEX >= 0x030C00A6
28298 32 : PyObject *tmp_value;
28299 32 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
28300 32 : if (value) {
28301 : #if CYTHON_COMPILING_IN_CPYTHON
28302 23 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
28303 : #endif
28304 0 : PyException_SetTraceback(value, tb);
28305 : }
28306 32 : tmp_value = tstate->current_exception;
28307 32 : tstate->current_exception = value;
28308 32 : Py_XDECREF(tmp_value);
28309 32 : Py_XDECREF(type);
28310 32 : Py_XDECREF(tb);
28311 : #else
28312 : PyObject *tmp_type, *tmp_value, *tmp_tb;
28313 : tmp_type = tstate->curexc_type;
28314 : tmp_value = tstate->curexc_value;
28315 : tmp_tb = tstate->curexc_traceback;
28316 : tstate->curexc_type = type;
28317 : tstate->curexc_value = value;
28318 : tstate->curexc_traceback = tb;
28319 : Py_XDECREF(tmp_type);
28320 : Py_XDECREF(tmp_value);
28321 : Py_XDECREF(tmp_tb);
28322 : #endif
28323 32 : }
28324 23 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28325 : #if PY_VERSION_HEX >= 0x030C00A6
28326 23 : PyObject* exc_value;
28327 23 : exc_value = tstate->current_exception;
28328 23 : tstate->current_exception = 0;
28329 23 : *value = exc_value;
28330 23 : *type = NULL;
28331 23 : *tb = NULL;
28332 23 : if (exc_value) {
28333 23 : *type = (PyObject*) Py_TYPE(exc_value);
28334 23 : Py_INCREF(*type);
28335 : #if CYTHON_COMPILING_IN_CPYTHON
28336 23 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
28337 23 : Py_XINCREF(*tb);
28338 : #else
28339 : *tb = PyException_GetTraceback(exc_value);
28340 : #endif
28341 : }
28342 : #else
28343 : *type = tstate->curexc_type;
28344 : *value = tstate->curexc_value;
28345 : *tb = tstate->curexc_traceback;
28346 : tstate->curexc_type = 0;
28347 : tstate->curexc_value = 0;
28348 : tstate->curexc_traceback = 0;
28349 : #endif
28350 23 : }
28351 : #endif
28352 :
28353 : /* PyObjectGetAttrStr */
28354 : #if CYTHON_USE_TYPE_SLOTS
28355 1190 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28356 1190 : PyTypeObject* tp = Py_TYPE(obj);
28357 1190 : if (likely(tp->tp_getattro))
28358 1190 : return tp->tp_getattro(obj, attr_name);
28359 : #if PY_MAJOR_VERSION < 3
28360 : if (likely(tp->tp_getattr))
28361 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28362 : #endif
28363 0 : return PyObject_GetAttr(obj, attr_name);
28364 : }
28365 : #endif
28366 :
28367 : /* PyObjectGetAttrStrNoError */
28368 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
28369 9 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
28370 9 : __Pyx_PyThreadState_declare
28371 9 : __Pyx_PyThreadState_assign
28372 9 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28373 9 : __Pyx_PyErr_Clear();
28374 9 : }
28375 : #endif
28376 81 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28377 81 : PyObject *result;
28378 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
28379 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
28380 : return result;
28381 : #else
28382 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
28383 81 : PyTypeObject* tp = Py_TYPE(obj);
28384 81 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28385 9 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28386 : }
28387 : #endif
28388 72 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28389 72 : if (unlikely(!result)) {
28390 9 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28391 : }
28392 : return result;
28393 : #endif
28394 : }
28395 :
28396 : /* GetBuiltinName */
28397 33 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
28398 33 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
28399 33 : if (unlikely(!result) && !PyErr_Occurred()) {
28400 0 : PyErr_Format(PyExc_NameError,
28401 : #if PY_MAJOR_VERSION >= 3
28402 : "name '%U' is not defined", name);
28403 : #else
28404 : "name '%.200s' is not defined", PyString_AS_STRING(name));
28405 : #endif
28406 : }
28407 33 : return result;
28408 : }
28409 :
28410 : /* TupleAndListFromArray */
28411 : #if CYTHON_COMPILING_IN_CPYTHON
28412 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
28413 : PyObject *v;
28414 : Py_ssize_t i;
28415 : for (i = 0; i < length; i++) {
28416 : v = dest[i] = src[i];
28417 : Py_INCREF(v);
28418 : }
28419 : }
28420 : static CYTHON_INLINE PyObject *
28421 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
28422 : {
28423 : PyObject *res;
28424 : if (n <= 0) {
28425 : Py_INCREF(__pyx_empty_tuple);
28426 : return __pyx_empty_tuple;
28427 : }
28428 : res = PyTuple_New(n);
28429 : if (unlikely(res == NULL)) return NULL;
28430 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
28431 : return res;
28432 : }
28433 : static CYTHON_INLINE PyObject *
28434 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
28435 : {
28436 : PyObject *res;
28437 : if (n <= 0) {
28438 : return PyList_New(0);
28439 : }
28440 : res = PyList_New(n);
28441 : if (unlikely(res == NULL)) return NULL;
28442 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
28443 : return res;
28444 : }
28445 : #endif
28446 :
28447 : /* BytesEquals */
28448 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
28449 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28450 : return PyObject_RichCompareBool(s1, s2, equals);
28451 : #else
28452 : if (s1 == s2) {
28453 : return (equals == Py_EQ);
28454 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
28455 : const char *ps1, *ps2;
28456 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
28457 : if (length != PyBytes_GET_SIZE(s2))
28458 : return (equals == Py_NE);
28459 : ps1 = PyBytes_AS_STRING(s1);
28460 : ps2 = PyBytes_AS_STRING(s2);
28461 : if (ps1[0] != ps2[0]) {
28462 : return (equals == Py_NE);
28463 : } else if (length == 1) {
28464 : return (equals == Py_EQ);
28465 : } else {
28466 : int result;
28467 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
28468 : Py_hash_t hash1, hash2;
28469 : hash1 = ((PyBytesObject*)s1)->ob_shash;
28470 : hash2 = ((PyBytesObject*)s2)->ob_shash;
28471 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28472 : return (equals == Py_NE);
28473 : }
28474 : #endif
28475 : result = memcmp(ps1, ps2, (size_t)length);
28476 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28477 : }
28478 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
28479 : return (equals == Py_NE);
28480 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
28481 : return (equals == Py_NE);
28482 : } else {
28483 : int result;
28484 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28485 : if (!py_result)
28486 : return -1;
28487 : result = __Pyx_PyObject_IsTrue(py_result);
28488 : Py_DECREF(py_result);
28489 : return result;
28490 : }
28491 : #endif
28492 : }
28493 :
28494 : /* UnicodeEquals */
28495 56 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
28496 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
28497 : return PyObject_RichCompareBool(s1, s2, equals);
28498 : #else
28499 : #if PY_MAJOR_VERSION < 3
28500 : PyObject* owned_ref = NULL;
28501 : #endif
28502 56 : int s1_is_unicode, s2_is_unicode;
28503 56 : if (s1 == s2) {
28504 47 : goto return_eq;
28505 : }
28506 9 : s1_is_unicode = PyUnicode_CheckExact(s1);
28507 9 : s2_is_unicode = PyUnicode_CheckExact(s2);
28508 : #if PY_MAJOR_VERSION < 3
28509 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
28510 : owned_ref = PyUnicode_FromObject(s2);
28511 : if (unlikely(!owned_ref))
28512 : return -1;
28513 : s2 = owned_ref;
28514 : s2_is_unicode = 1;
28515 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
28516 : owned_ref = PyUnicode_FromObject(s1);
28517 : if (unlikely(!owned_ref))
28518 : return -1;
28519 : s1 = owned_ref;
28520 : s1_is_unicode = 1;
28521 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
28522 : return __Pyx_PyBytes_Equals(s1, s2, equals);
28523 : }
28524 : #endif
28525 9 : if (s1_is_unicode & s2_is_unicode) {
28526 9 : Py_ssize_t length;
28527 9 : int kind;
28528 9 : void *data1, *data2;
28529 9 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
28530 : return -1;
28531 9 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
28532 9 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
28533 8 : goto return_ne;
28534 : }
28535 : #if CYTHON_USE_UNICODE_INTERNALS
28536 : {
28537 1 : Py_hash_t hash1, hash2;
28538 : #if CYTHON_PEP393_ENABLED
28539 1 : hash1 = ((PyASCIIObject*)s1)->hash;
28540 1 : hash2 = ((PyASCIIObject*)s2)->hash;
28541 : #else
28542 : hash1 = ((PyUnicodeObject*)s1)->hash;
28543 : hash2 = ((PyUnicodeObject*)s2)->hash;
28544 : #endif
28545 1 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28546 1 : goto return_ne;
28547 : }
28548 : }
28549 : #endif
28550 0 : kind = __Pyx_PyUnicode_KIND(s1);
28551 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
28552 0 : goto return_ne;
28553 : }
28554 0 : data1 = __Pyx_PyUnicode_DATA(s1);
28555 0 : data2 = __Pyx_PyUnicode_DATA(s2);
28556 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
28557 0 : goto return_ne;
28558 0 : } else if (length == 1) {
28559 0 : goto return_eq;
28560 : } else {
28561 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
28562 : #if PY_MAJOR_VERSION < 3
28563 : Py_XDECREF(owned_ref);
28564 : #endif
28565 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
28566 : }
28567 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
28568 0 : goto return_ne;
28569 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
28570 0 : goto return_ne;
28571 : } else {
28572 0 : int result;
28573 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28574 : #if PY_MAJOR_VERSION < 3
28575 : Py_XDECREF(owned_ref);
28576 : #endif
28577 0 : if (!py_result)
28578 : return -1;
28579 0 : result = __Pyx_PyObject_IsTrue(py_result);
28580 0 : Py_DECREF(py_result);
28581 0 : return result;
28582 : }
28583 47 : return_eq:
28584 : #if PY_MAJOR_VERSION < 3
28585 : Py_XDECREF(owned_ref);
28586 : #endif
28587 47 : return (equals == Py_EQ);
28588 9 : return_ne:
28589 : #if PY_MAJOR_VERSION < 3
28590 : Py_XDECREF(owned_ref);
28591 : #endif
28592 9 : return (equals == Py_NE);
28593 : #endif
28594 : }
28595 :
28596 : /* fastcall */
28597 : #if CYTHON_METH_FASTCALL
28598 28 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
28599 : {
28600 28 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
28601 28 : for (i = 0; i < n; i++)
28602 : {
28603 28 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
28604 : }
28605 0 : for (i = 0; i < n; i++)
28606 : {
28607 0 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
28608 0 : if (unlikely(eq != 0)) {
28609 0 : if (unlikely(eq < 0)) return NULL;
28610 0 : return kwvalues[i];
28611 : }
28612 : }
28613 : return NULL;
28614 : }
28615 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
28616 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
28617 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
28618 : PyObject *dict;
28619 : dict = PyDict_New();
28620 : if (unlikely(!dict))
28621 : return NULL;
28622 : for (i=0; i<nkwargs; i++) {
28623 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
28624 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
28625 : goto bad;
28626 : }
28627 : return dict;
28628 : bad:
28629 : Py_DECREF(dict);
28630 : return NULL;
28631 : }
28632 : #endif
28633 : #endif
28634 :
28635 : /* RaiseArgTupleInvalid */
28636 0 : static void __Pyx_RaiseArgtupleInvalid(
28637 : const char* func_name,
28638 : int exact,
28639 : Py_ssize_t num_min,
28640 : Py_ssize_t num_max,
28641 : Py_ssize_t num_found)
28642 : {
28643 0 : Py_ssize_t num_expected;
28644 0 : const char *more_or_less;
28645 0 : if (num_found < num_min) {
28646 : num_expected = num_min;
28647 : more_or_less = "at least";
28648 : } else {
28649 0 : num_expected = num_max;
28650 0 : more_or_less = "at most";
28651 : }
28652 0 : if (exact) {
28653 0 : more_or_less = "exactly";
28654 : }
28655 0 : PyErr_Format(PyExc_TypeError,
28656 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
28657 : func_name, more_or_less, num_expected,
28658 : (num_expected == 1) ? "" : "s", num_found);
28659 0 : }
28660 :
28661 : /* RaiseDoubleKeywords */
28662 0 : static void __Pyx_RaiseDoubleKeywordsError(
28663 : const char* func_name,
28664 : PyObject* kw_name)
28665 : {
28666 0 : PyErr_Format(PyExc_TypeError,
28667 : #if PY_MAJOR_VERSION >= 3
28668 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
28669 : #else
28670 : "%s() got multiple values for keyword argument '%s'", func_name,
28671 : PyString_AsString(kw_name));
28672 : #endif
28673 : }
28674 :
28675 : /* ParseKeywords */
28676 0 : static int __Pyx_ParseOptionalKeywords(
28677 : PyObject *kwds,
28678 : PyObject *const *kwvalues,
28679 : PyObject **argnames[],
28680 : PyObject *kwds2,
28681 : PyObject *values[],
28682 : Py_ssize_t num_pos_args,
28683 : const char* function_name)
28684 : {
28685 0 : PyObject *key = 0, *value = 0;
28686 0 : Py_ssize_t pos = 0;
28687 0 : PyObject*** name;
28688 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
28689 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
28690 0 : while (1) {
28691 0 : Py_XDECREF(key); key = NULL;
28692 0 : Py_XDECREF(value); value = NULL;
28693 0 : if (kwds_is_tuple) {
28694 0 : Py_ssize_t size;
28695 : #if CYTHON_ASSUME_SAFE_MACROS
28696 0 : size = PyTuple_GET_SIZE(kwds);
28697 : #else
28698 : size = PyTuple_Size(kwds);
28699 : if (size < 0) goto bad;
28700 : #endif
28701 0 : if (pos >= size) break;
28702 : #if CYTHON_AVOID_BORROWED_REFS
28703 : key = __Pyx_PySequence_ITEM(kwds, pos);
28704 : if (!key) goto bad;
28705 : #elif CYTHON_ASSUME_SAFE_MACROS
28706 0 : key = PyTuple_GET_ITEM(kwds, pos);
28707 : #else
28708 : key = PyTuple_GetItem(kwds, pos);
28709 : if (!key) goto bad;
28710 : #endif
28711 0 : value = kwvalues[pos];
28712 0 : pos++;
28713 : }
28714 : else
28715 : {
28716 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
28717 : #if CYTHON_AVOID_BORROWED_REFS
28718 : Py_INCREF(key);
28719 : #endif
28720 : }
28721 0 : name = first_kw_arg;
28722 0 : while (*name && (**name != key)) name++;
28723 0 : if (*name) {
28724 0 : values[name-argnames] = value;
28725 : #if CYTHON_AVOID_BORROWED_REFS
28726 : Py_INCREF(value);
28727 : Py_DECREF(key);
28728 : #endif
28729 0 : key = NULL;
28730 0 : value = NULL;
28731 0 : continue;
28732 : }
28733 : #if !CYTHON_AVOID_BORROWED_REFS
28734 0 : Py_INCREF(key);
28735 : #endif
28736 0 : Py_INCREF(value);
28737 0 : name = first_kw_arg;
28738 : #if PY_MAJOR_VERSION < 3
28739 : if (likely(PyString_Check(key))) {
28740 : while (*name) {
28741 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
28742 : && _PyString_Eq(**name, key)) {
28743 : values[name-argnames] = value;
28744 : #if CYTHON_AVOID_BORROWED_REFS
28745 : value = NULL;
28746 : #endif
28747 : break;
28748 : }
28749 : name++;
28750 : }
28751 : if (*name) continue;
28752 : else {
28753 : PyObject*** argname = argnames;
28754 : while (argname != first_kw_arg) {
28755 : if ((**argname == key) || (
28756 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
28757 : && _PyString_Eq(**argname, key))) {
28758 : goto arg_passed_twice;
28759 : }
28760 : argname++;
28761 : }
28762 : }
28763 : } else
28764 : #endif
28765 0 : if (likely(PyUnicode_Check(key))) {
28766 0 : while (*name) {
28767 0 : int cmp = (
28768 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28769 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28770 : #endif
28771 0 : PyUnicode_Compare(**name, key)
28772 : );
28773 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28774 0 : if (cmp == 0) {
28775 0 : values[name-argnames] = value;
28776 : #if CYTHON_AVOID_BORROWED_REFS
28777 : value = NULL;
28778 : #endif
28779 0 : break;
28780 : }
28781 0 : name++;
28782 : }
28783 0 : if (*name) continue;
28784 : else {
28785 : PyObject*** argname = argnames;
28786 0 : while (argname != first_kw_arg) {
28787 0 : int cmp = (**argname == key) ? 0 :
28788 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28789 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
28790 : #endif
28791 0 : PyUnicode_Compare(**argname, key);
28792 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28793 0 : if (cmp == 0) goto arg_passed_twice;
28794 0 : argname++;
28795 : }
28796 : }
28797 : } else
28798 0 : goto invalid_keyword_type;
28799 0 : if (kwds2) {
28800 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
28801 : } else {
28802 0 : goto invalid_keyword;
28803 : }
28804 : }
28805 0 : Py_XDECREF(key);
28806 0 : Py_XDECREF(value);
28807 0 : return 0;
28808 0 : arg_passed_twice:
28809 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
28810 0 : goto bad;
28811 0 : invalid_keyword_type:
28812 0 : PyErr_Format(PyExc_TypeError,
28813 : "%.200s() keywords must be strings", function_name);
28814 0 : goto bad;
28815 0 : invalid_keyword:
28816 : #if PY_MAJOR_VERSION < 3
28817 : PyErr_Format(PyExc_TypeError,
28818 : "%.200s() got an unexpected keyword argument '%.200s'",
28819 : function_name, PyString_AsString(key));
28820 : #else
28821 0 : PyErr_Format(PyExc_TypeError,
28822 : "%s() got an unexpected keyword argument '%U'",
28823 : function_name, key);
28824 : #endif
28825 0 : bad:
28826 0 : Py_XDECREF(key);
28827 0 : Py_XDECREF(value);
28828 0 : return -1;
28829 : }
28830 :
28831 : /* ArgTypeTest */
28832 0 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
28833 : {
28834 0 : __Pyx_TypeName type_name;
28835 0 : __Pyx_TypeName obj_type_name;
28836 0 : if (unlikely(!type)) {
28837 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
28838 0 : return 0;
28839 : }
28840 0 : else if (exact) {
28841 : #if PY_MAJOR_VERSION == 2
28842 : if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
28843 : #endif
28844 : }
28845 : else {
28846 0 : if (likely(__Pyx_TypeCheck(obj, type))) return 1;
28847 : }
28848 0 : type_name = __Pyx_PyType_GetName(type);
28849 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
28850 0 : PyErr_Format(PyExc_TypeError,
28851 : "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
28852 : ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
28853 0 : __Pyx_DECREF_TypeName(type_name);
28854 0 : __Pyx_DECREF_TypeName(obj_type_name);
28855 0 : return 0;
28856 : }
28857 :
28858 : /* RaiseException */
28859 : #if PY_MAJOR_VERSION < 3
28860 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28861 : __Pyx_PyThreadState_declare
28862 : CYTHON_UNUSED_VAR(cause);
28863 : Py_XINCREF(type);
28864 : if (!value || value == Py_None)
28865 : value = NULL;
28866 : else
28867 : Py_INCREF(value);
28868 : if (!tb || tb == Py_None)
28869 : tb = NULL;
28870 : else {
28871 : Py_INCREF(tb);
28872 : if (!PyTraceBack_Check(tb)) {
28873 : PyErr_SetString(PyExc_TypeError,
28874 : "raise: arg 3 must be a traceback or None");
28875 : goto raise_error;
28876 : }
28877 : }
28878 : if (PyType_Check(type)) {
28879 : #if CYTHON_COMPILING_IN_PYPY
28880 : if (!value) {
28881 : Py_INCREF(Py_None);
28882 : value = Py_None;
28883 : }
28884 : #endif
28885 : PyErr_NormalizeException(&type, &value, &tb);
28886 : } else {
28887 : if (value) {
28888 : PyErr_SetString(PyExc_TypeError,
28889 : "instance exception may not have a separate value");
28890 : goto raise_error;
28891 : }
28892 : value = type;
28893 : type = (PyObject*) Py_TYPE(type);
28894 : Py_INCREF(type);
28895 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
28896 : PyErr_SetString(PyExc_TypeError,
28897 : "raise: exception class must be a subclass of BaseException");
28898 : goto raise_error;
28899 : }
28900 : }
28901 : __Pyx_PyThreadState_assign
28902 : __Pyx_ErrRestore(type, value, tb);
28903 : return;
28904 : raise_error:
28905 : Py_XDECREF(value);
28906 : Py_XDECREF(type);
28907 : Py_XDECREF(tb);
28908 : return;
28909 : }
28910 : #else
28911 17 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
28912 17 : PyObject* owned_instance = NULL;
28913 17 : if (tb == Py_None) {
28914 : tb = 0;
28915 17 : } else if (tb && !PyTraceBack_Check(tb)) {
28916 0 : PyErr_SetString(PyExc_TypeError,
28917 : "raise: arg 3 must be a traceback or None");
28918 0 : goto bad;
28919 : }
28920 17 : if (value == Py_None)
28921 0 : value = 0;
28922 17 : if (PyExceptionInstance_Check(type)) {
28923 17 : if (value) {
28924 0 : PyErr_SetString(PyExc_TypeError,
28925 : "instance exception may not have a separate value");
28926 0 : goto bad;
28927 : }
28928 : value = type;
28929 : type = (PyObject*) Py_TYPE(value);
28930 0 : } else if (PyExceptionClass_Check(type)) {
28931 0 : PyObject *instance_class = NULL;
28932 0 : if (value && PyExceptionInstance_Check(value)) {
28933 0 : instance_class = (PyObject*) Py_TYPE(value);
28934 0 : if (instance_class != type) {
28935 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
28936 0 : if (!is_subclass) {
28937 : instance_class = NULL;
28938 0 : } else if (unlikely(is_subclass == -1)) {
28939 0 : goto bad;
28940 : } else {
28941 : type = instance_class;
28942 : }
28943 : }
28944 : }
28945 : if (!instance_class) {
28946 0 : PyObject *args;
28947 0 : if (!value)
28948 0 : args = PyTuple_New(0);
28949 0 : else if (PyTuple_Check(value)) {
28950 0 : Py_INCREF(value);
28951 0 : args = value;
28952 : } else
28953 0 : args = PyTuple_Pack(1, value);
28954 0 : if (!args)
28955 0 : goto bad;
28956 0 : owned_instance = PyObject_Call(type, args, NULL);
28957 0 : Py_DECREF(args);
28958 0 : if (!owned_instance)
28959 0 : goto bad;
28960 0 : value = owned_instance;
28961 0 : if (!PyExceptionInstance_Check(value)) {
28962 0 : PyErr_Format(PyExc_TypeError,
28963 : "calling %R should have returned an instance of "
28964 : "BaseException, not %R",
28965 : type, Py_TYPE(value));
28966 0 : goto bad;
28967 : }
28968 : }
28969 : } else {
28970 0 : PyErr_SetString(PyExc_TypeError,
28971 : "raise: exception class must be a subclass of BaseException");
28972 0 : goto bad;
28973 : }
28974 17 : if (cause) {
28975 0 : PyObject *fixed_cause;
28976 0 : if (cause == Py_None) {
28977 : fixed_cause = NULL;
28978 0 : } else if (PyExceptionClass_Check(cause)) {
28979 0 : fixed_cause = PyObject_CallObject(cause, NULL);
28980 0 : if (fixed_cause == NULL)
28981 0 : goto bad;
28982 0 : } else if (PyExceptionInstance_Check(cause)) {
28983 0 : fixed_cause = cause;
28984 0 : Py_INCREF(fixed_cause);
28985 : } else {
28986 0 : PyErr_SetString(PyExc_TypeError,
28987 : "exception causes must derive from "
28988 : "BaseException");
28989 0 : goto bad;
28990 : }
28991 0 : PyException_SetCause(value, fixed_cause);
28992 : }
28993 17 : PyErr_SetObject(type, value);
28994 17 : if (tb) {
28995 : #if PY_VERSION_HEX >= 0x030C00A6
28996 0 : PyException_SetTraceback(value, tb);
28997 : #elif CYTHON_FAST_THREAD_STATE
28998 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
28999 : PyObject* tmp_tb = tstate->curexc_traceback;
29000 : if (tb != tmp_tb) {
29001 : Py_INCREF(tb);
29002 : tstate->curexc_traceback = tb;
29003 : Py_XDECREF(tmp_tb);
29004 : }
29005 : #else
29006 : PyObject *tmp_type, *tmp_value, *tmp_tb;
29007 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
29008 : Py_INCREF(tb);
29009 : PyErr_Restore(tmp_type, tmp_value, tb);
29010 : Py_XDECREF(tmp_tb);
29011 : #endif
29012 : }
29013 17 : bad:
29014 17 : Py_XDECREF(owned_instance);
29015 17 : return;
29016 : }
29017 : #endif
29018 :
29019 : /* PyFunctionFastCall */
29020 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
29021 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
29022 : PyObject *globals) {
29023 : PyFrameObject *f;
29024 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
29025 : PyObject **fastlocals;
29026 : Py_ssize_t i;
29027 : PyObject *result;
29028 : assert(globals != NULL);
29029 : /* XXX Perhaps we should create a specialized
29030 : PyFrame_New() that doesn't take locals, but does
29031 : take builtins without sanity checking them.
29032 : */
29033 : assert(tstate != NULL);
29034 : f = PyFrame_New(tstate, co, globals, NULL);
29035 : if (f == NULL) {
29036 : return NULL;
29037 : }
29038 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
29039 : for (i = 0; i < na; i++) {
29040 : Py_INCREF(*args);
29041 : fastlocals[i] = *args++;
29042 : }
29043 : result = PyEval_EvalFrameEx(f,0);
29044 : ++tstate->recursion_depth;
29045 : Py_DECREF(f);
29046 : --tstate->recursion_depth;
29047 : return result;
29048 : }
29049 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
29050 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
29051 : PyObject *globals = PyFunction_GET_GLOBALS(func);
29052 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
29053 : PyObject *closure;
29054 : #if PY_MAJOR_VERSION >= 3
29055 : PyObject *kwdefs;
29056 : #endif
29057 : PyObject *kwtuple, **k;
29058 : PyObject **d;
29059 : Py_ssize_t nd;
29060 : Py_ssize_t nk;
29061 : PyObject *result;
29062 : assert(kwargs == NULL || PyDict_Check(kwargs));
29063 : nk = kwargs ? PyDict_Size(kwargs) : 0;
29064 : #if PY_MAJOR_VERSION < 3
29065 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
29066 : return NULL;
29067 : }
29068 : #else
29069 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
29070 : return NULL;
29071 : }
29072 : #endif
29073 : if (
29074 : #if PY_MAJOR_VERSION >= 3
29075 : co->co_kwonlyargcount == 0 &&
29076 : #endif
29077 : likely(kwargs == NULL || nk == 0) &&
29078 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
29079 : if (argdefs == NULL && co->co_argcount == nargs) {
29080 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
29081 : goto done;
29082 : }
29083 : else if (nargs == 0 && argdefs != NULL
29084 : && co->co_argcount == Py_SIZE(argdefs)) {
29085 : /* function called with no arguments, but all parameters have
29086 : a default value: use default values as arguments .*/
29087 : args = &PyTuple_GET_ITEM(argdefs, 0);
29088 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
29089 : goto done;
29090 : }
29091 : }
29092 : if (kwargs != NULL) {
29093 : Py_ssize_t pos, i;
29094 : kwtuple = PyTuple_New(2 * nk);
29095 : if (kwtuple == NULL) {
29096 : result = NULL;
29097 : goto done;
29098 : }
29099 : k = &PyTuple_GET_ITEM(kwtuple, 0);
29100 : pos = i = 0;
29101 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
29102 : Py_INCREF(k[i]);
29103 : Py_INCREF(k[i+1]);
29104 : i += 2;
29105 : }
29106 : nk = i / 2;
29107 : }
29108 : else {
29109 : kwtuple = NULL;
29110 : k = NULL;
29111 : }
29112 : closure = PyFunction_GET_CLOSURE(func);
29113 : #if PY_MAJOR_VERSION >= 3
29114 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
29115 : #endif
29116 : if (argdefs != NULL) {
29117 : d = &PyTuple_GET_ITEM(argdefs, 0);
29118 : nd = Py_SIZE(argdefs);
29119 : }
29120 : else {
29121 : d = NULL;
29122 : nd = 0;
29123 : }
29124 : #if PY_MAJOR_VERSION >= 3
29125 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
29126 : args, (int)nargs,
29127 : k, (int)nk,
29128 : d, (int)nd, kwdefs, closure);
29129 : #else
29130 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
29131 : args, (int)nargs,
29132 : k, (int)nk,
29133 : d, (int)nd, closure);
29134 : #endif
29135 : Py_XDECREF(kwtuple);
29136 : done:
29137 : Py_LeaveRecursiveCall();
29138 : return result;
29139 : }
29140 : #endif
29141 :
29142 : /* PyObjectCall */
29143 : #if CYTHON_COMPILING_IN_CPYTHON
29144 497 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29145 497 : PyObject *result;
29146 497 : ternaryfunc call = Py_TYPE(func)->tp_call;
29147 497 : if (unlikely(!call))
29148 0 : return PyObject_Call(func, arg, kw);
29149 : #if PY_MAJOR_VERSION < 3
29150 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29151 : return NULL;
29152 : #else
29153 497 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
29154 : return NULL;
29155 : #endif
29156 497 : result = (*call)(func, arg, kw);
29157 497 : Py_LeaveRecursiveCall();
29158 497 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29159 0 : PyErr_SetString(
29160 : PyExc_SystemError,
29161 : "NULL result without error in PyObject_Call");
29162 : }
29163 : return result;
29164 : }
29165 : #endif
29166 :
29167 : /* PyObjectCallMethO */
29168 : #if CYTHON_COMPILING_IN_CPYTHON
29169 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
29170 0 : PyObject *self, *result;
29171 0 : PyCFunction cfunc;
29172 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
29173 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
29174 : #if PY_MAJOR_VERSION < 3
29175 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29176 : return NULL;
29177 : #else
29178 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
29179 : return NULL;
29180 : #endif
29181 0 : result = cfunc(self, arg);
29182 0 : Py_LeaveRecursiveCall();
29183 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29184 0 : PyErr_SetString(
29185 : PyExc_SystemError,
29186 : "NULL result without error in PyObject_Call");
29187 : }
29188 : return result;
29189 : }
29190 : #endif
29191 :
29192 : /* PyObjectFastCall */
29193 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
29194 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
29195 : PyObject *argstuple;
29196 : PyObject *result = 0;
29197 : size_t i;
29198 : argstuple = PyTuple_New((Py_ssize_t)nargs);
29199 : if (unlikely(!argstuple)) return NULL;
29200 : for (i = 0; i < nargs; i++) {
29201 : Py_INCREF(args[i]);
29202 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
29203 : }
29204 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
29205 : bad:
29206 : Py_DECREF(argstuple);
29207 : return result;
29208 : }
29209 : #endif
29210 395 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
29211 395 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
29212 : #if CYTHON_COMPILING_IN_CPYTHON
29213 395 : if (nargs == 0 && kwargs == NULL) {
29214 16 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
29215 0 : return __Pyx_PyObject_CallMethO(func, NULL);
29216 : }
29217 379 : else if (nargs == 1 && kwargs == NULL) {
29218 272 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
29219 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
29220 : }
29221 : #endif
29222 : #if PY_VERSION_HEX < 0x030800B1
29223 : #if CYTHON_FAST_PYCCALL
29224 : if (PyCFunction_Check(func)) {
29225 : if (kwargs) {
29226 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
29227 : } else {
29228 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
29229 : }
29230 : }
29231 : #if PY_VERSION_HEX >= 0x030700A1
29232 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
29233 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
29234 : }
29235 : #endif
29236 : #endif
29237 : #if CYTHON_FAST_PYCALL
29238 : if (PyFunction_Check(func)) {
29239 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
29240 : }
29241 : #endif
29242 : #endif
29243 395 : if (kwargs == NULL) {
29244 : #if CYTHON_VECTORCALL
29245 : #if PY_VERSION_HEX < 0x03090000
29246 : vectorcallfunc f = _PyVectorcall_Function(func);
29247 : #else
29248 395 : vectorcallfunc f = PyVectorcall_Function(func);
29249 : #endif
29250 395 : if (f) {
29251 292 : return f(func, args, (size_t)nargs, NULL);
29252 : }
29253 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
29254 : if (__Pyx_CyFunction_CheckExact(func)) {
29255 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
29256 : if (f) return f(func, args, (size_t)nargs, NULL);
29257 : }
29258 : #endif
29259 : }
29260 103 : if (nargs == 0) {
29261 0 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
29262 : }
29263 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
29264 103 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
29265 : #else
29266 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
29267 : #endif
29268 : }
29269 :
29270 : /* RaiseUnexpectedTypeError */
29271 : static int
29272 0 : __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
29273 : {
29274 0 : __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29275 0 : PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
29276 : expected, obj_type_name);
29277 0 : __Pyx_DECREF_TypeName(obj_type_name);
29278 0 : return 0;
29279 : }
29280 :
29281 : /* CIntToDigits */
29282 : static const char DIGIT_PAIRS_10[2*10*10+1] = {
29283 : "00010203040506070809"
29284 : "10111213141516171819"
29285 : "20212223242526272829"
29286 : "30313233343536373839"
29287 : "40414243444546474849"
29288 : "50515253545556575859"
29289 : "60616263646566676869"
29290 : "70717273747576777879"
29291 : "80818283848586878889"
29292 : "90919293949596979899"
29293 : };
29294 : static const char DIGIT_PAIRS_8[2*8*8+1] = {
29295 : "0001020304050607"
29296 : "1011121314151617"
29297 : "2021222324252627"
29298 : "3031323334353637"
29299 : "4041424344454647"
29300 : "5051525354555657"
29301 : "6061626364656667"
29302 : "7071727374757677"
29303 : };
29304 : static const char DIGITS_HEX[2*16+1] = {
29305 : "0123456789abcdef"
29306 : "0123456789ABCDEF"
29307 : };
29308 :
29309 : /* BuildPyUnicode */
29310 0 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
29311 : int prepend_sign, char padding_char) {
29312 0 : PyObject *uval;
29313 0 : Py_ssize_t uoffset = ulength - clength;
29314 : #if CYTHON_USE_UNICODE_INTERNALS
29315 0 : Py_ssize_t i;
29316 : #if CYTHON_PEP393_ENABLED
29317 0 : void *udata;
29318 0 : uval = PyUnicode_New(ulength, 127);
29319 0 : if (unlikely(!uval)) return NULL;
29320 0 : udata = PyUnicode_DATA(uval);
29321 : #else
29322 : Py_UNICODE *udata;
29323 : uval = PyUnicode_FromUnicode(NULL, ulength);
29324 : if (unlikely(!uval)) return NULL;
29325 : udata = PyUnicode_AS_UNICODE(uval);
29326 : #endif
29327 0 : if (uoffset > 0) {
29328 0 : i = 0;
29329 0 : if (prepend_sign) {
29330 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
29331 0 : i++;
29332 : }
29333 0 : for (; i < uoffset; i++) {
29334 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
29335 : }
29336 : }
29337 0 : for (i=0; i < clength; i++) {
29338 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
29339 : }
29340 : #else
29341 : {
29342 : PyObject *sign = NULL, *padding = NULL;
29343 : uval = NULL;
29344 : if (uoffset > 0) {
29345 : prepend_sign = !!prepend_sign;
29346 : if (uoffset > prepend_sign) {
29347 : padding = PyUnicode_FromOrdinal(padding_char);
29348 : if (likely(padding) && uoffset > prepend_sign + 1) {
29349 : PyObject *tmp;
29350 : PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
29351 : if (unlikely(!repeat)) goto done_or_error;
29352 : tmp = PyNumber_Multiply(padding, repeat);
29353 : Py_DECREF(repeat);
29354 : Py_DECREF(padding);
29355 : padding = tmp;
29356 : }
29357 : if (unlikely(!padding)) goto done_or_error;
29358 : }
29359 : if (prepend_sign) {
29360 : sign = PyUnicode_FromOrdinal('-');
29361 : if (unlikely(!sign)) goto done_or_error;
29362 : }
29363 : }
29364 : uval = PyUnicode_DecodeASCII(chars, clength, NULL);
29365 : if (likely(uval) && padding) {
29366 : PyObject *tmp = PyNumber_Add(padding, uval);
29367 : Py_DECREF(uval);
29368 : uval = tmp;
29369 : }
29370 : if (likely(uval) && sign) {
29371 : PyObject *tmp = PyNumber_Add(sign, uval);
29372 : Py_DECREF(uval);
29373 : uval = tmp;
29374 : }
29375 : done_or_error:
29376 : Py_XDECREF(padding);
29377 : Py_XDECREF(sign);
29378 : }
29379 : #endif
29380 : return uval;
29381 : }
29382 :
29383 : /* CIntToPyUnicode */
29384 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
29385 0 : char digits[sizeof(int)*3+2];
29386 0 : char *dpos, *end = digits + sizeof(int)*3+2;
29387 0 : const char *hex_digits = DIGITS_HEX;
29388 0 : Py_ssize_t length, ulength;
29389 0 : int prepend_sign, last_one_off;
29390 0 : int remaining;
29391 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29392 : #pragma GCC diagnostic push
29393 : #pragma GCC diagnostic ignored "-Wconversion"
29394 : #endif
29395 0 : const int neg_one = (int) -1, const_zero = (int) 0;
29396 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29397 : #pragma GCC diagnostic pop
29398 : #endif
29399 0 : const int is_unsigned = neg_one > const_zero;
29400 0 : if (format_char == 'X') {
29401 0 : hex_digits += 16;
29402 0 : format_char = 'x';
29403 : }
29404 0 : remaining = value;
29405 0 : last_one_off = 0;
29406 0 : dpos = end;
29407 0 : do {
29408 0 : int digit_pos;
29409 0 : switch (format_char) {
29410 0 : case 'o':
29411 0 : digit_pos = abs((int)(remaining % (8*8)));
29412 0 : remaining = (int) (remaining / (8*8));
29413 0 : dpos -= 2;
29414 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29415 0 : last_one_off = (digit_pos < 8);
29416 0 : break;
29417 0 : case 'd':
29418 0 : digit_pos = abs((int)(remaining % (10*10)));
29419 0 : remaining = (int) (remaining / (10*10));
29420 0 : dpos -= 2;
29421 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29422 0 : last_one_off = (digit_pos < 10);
29423 0 : break;
29424 0 : case 'x':
29425 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29426 0 : remaining = (int) (remaining / 16);
29427 0 : break;
29428 : default:
29429 : assert(0);
29430 : break;
29431 : }
29432 0 : } while (unlikely(remaining != 0));
29433 0 : assert(!last_one_off || *dpos == '0');
29434 0 : dpos += last_one_off;
29435 0 : length = end - dpos;
29436 0 : ulength = length;
29437 0 : prepend_sign = 0;
29438 0 : if (!is_unsigned && value <= neg_one) {
29439 0 : if (padding_char == ' ' || width <= length + 1) {
29440 0 : *(--dpos) = '-';
29441 0 : ++length;
29442 : } else {
29443 : prepend_sign = 1;
29444 : }
29445 0 : ++ulength;
29446 : }
29447 0 : if (width > ulength) {
29448 : ulength = width;
29449 : }
29450 0 : if (ulength == 1) {
29451 0 : return PyUnicode_FromOrdinal(*dpos);
29452 : }
29453 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29454 : }
29455 :
29456 : /* CIntToPyUnicode */
29457 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
29458 0 : char digits[sizeof(Py_ssize_t)*3+2];
29459 0 : char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
29460 0 : const char *hex_digits = DIGITS_HEX;
29461 0 : Py_ssize_t length, ulength;
29462 0 : int prepend_sign, last_one_off;
29463 0 : Py_ssize_t remaining;
29464 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29465 : #pragma GCC diagnostic push
29466 : #pragma GCC diagnostic ignored "-Wconversion"
29467 : #endif
29468 0 : const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
29469 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29470 : #pragma GCC diagnostic pop
29471 : #endif
29472 0 : const int is_unsigned = neg_one > const_zero;
29473 0 : if (format_char == 'X') {
29474 0 : hex_digits += 16;
29475 0 : format_char = 'x';
29476 : }
29477 0 : remaining = value;
29478 0 : last_one_off = 0;
29479 0 : dpos = end;
29480 0 : do {
29481 0 : int digit_pos;
29482 0 : switch (format_char) {
29483 0 : case 'o':
29484 0 : digit_pos = abs((int)(remaining % (8*8)));
29485 0 : remaining = (Py_ssize_t) (remaining / (8*8));
29486 0 : dpos -= 2;
29487 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
29488 0 : last_one_off = (digit_pos < 8);
29489 0 : break;
29490 0 : case 'd':
29491 0 : digit_pos = abs((int)(remaining % (10*10)));
29492 0 : remaining = (Py_ssize_t) (remaining / (10*10));
29493 0 : dpos -= 2;
29494 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
29495 0 : last_one_off = (digit_pos < 10);
29496 0 : break;
29497 0 : case 'x':
29498 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
29499 0 : remaining = (Py_ssize_t) (remaining / 16);
29500 0 : break;
29501 : default:
29502 : assert(0);
29503 : break;
29504 : }
29505 0 : } while (unlikely(remaining != 0));
29506 0 : assert(!last_one_off || *dpos == '0');
29507 0 : dpos += last_one_off;
29508 0 : length = end - dpos;
29509 0 : ulength = length;
29510 0 : prepend_sign = 0;
29511 0 : if (!is_unsigned && value <= neg_one) {
29512 0 : if (padding_char == ' ' || width <= length + 1) {
29513 0 : *(--dpos) = '-';
29514 0 : ++length;
29515 : } else {
29516 : prepend_sign = 1;
29517 : }
29518 0 : ++ulength;
29519 : }
29520 0 : if (width > ulength) {
29521 : ulength = width;
29522 : }
29523 0 : if (ulength == 1) {
29524 0 : return PyUnicode_FromOrdinal(*dpos);
29525 : }
29526 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
29527 : }
29528 :
29529 : /* JoinPyUnicode */
29530 0 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
29531 : Py_UCS4 max_char) {
29532 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29533 0 : PyObject *result_uval;
29534 0 : int result_ukind, kind_shift;
29535 0 : Py_ssize_t i, char_pos;
29536 0 : void *result_udata;
29537 0 : CYTHON_MAYBE_UNUSED_VAR(max_char);
29538 : #if CYTHON_PEP393_ENABLED
29539 0 : result_uval = PyUnicode_New(result_ulength, max_char);
29540 0 : if (unlikely(!result_uval)) return NULL;
29541 0 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
29542 0 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
29543 0 : result_udata = PyUnicode_DATA(result_uval);
29544 : #else
29545 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
29546 : if (unlikely(!result_uval)) return NULL;
29547 : result_ukind = sizeof(Py_UNICODE);
29548 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
29549 : result_udata = PyUnicode_AS_UNICODE(result_uval);
29550 : #endif
29551 0 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
29552 0 : char_pos = 0;
29553 0 : for (i=0; i < value_count; i++) {
29554 0 : int ukind;
29555 0 : Py_ssize_t ulength;
29556 0 : void *udata;
29557 0 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
29558 0 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
29559 : goto bad;
29560 0 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
29561 0 : if (unlikely(!ulength))
29562 0 : continue;
29563 0 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
29564 0 : goto overflow;
29565 0 : ukind = __Pyx_PyUnicode_KIND(uval);
29566 0 : udata = __Pyx_PyUnicode_DATA(uval);
29567 0 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
29568 0 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
29569 : } else {
29570 : #if PY_VERSION_HEX >= 0x030d0000
29571 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
29572 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
29573 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
29574 : #else
29575 : Py_ssize_t j;
29576 : for (j=0; j < ulength; j++) {
29577 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
29578 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
29579 : }
29580 : #endif
29581 : }
29582 0 : char_pos += ulength;
29583 : }
29584 : return result_uval;
29585 0 : overflow:
29586 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
29587 0 : bad:
29588 0 : Py_DECREF(result_uval);
29589 : return NULL;
29590 : #else
29591 : CYTHON_UNUSED_VAR(max_char);
29592 : CYTHON_UNUSED_VAR(result_ulength);
29593 : CYTHON_UNUSED_VAR(value_count);
29594 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
29595 : #endif
29596 : }
29597 :
29598 : /* GetAttr */
29599 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29600 : #if CYTHON_USE_TYPE_SLOTS
29601 : #if PY_MAJOR_VERSION >= 3
29602 0 : if (likely(PyUnicode_Check(n)))
29603 : #else
29604 : if (likely(PyString_Check(n)))
29605 : #endif
29606 0 : return __Pyx_PyObject_GetAttrStr(o, n);
29607 : #endif
29608 0 : return PyObject_GetAttr(o, n);
29609 : }
29610 :
29611 : /* GetItemInt */
29612 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29613 0 : PyObject *r;
29614 0 : if (unlikely(!j)) return NULL;
29615 0 : r = PyObject_GetItem(o, j);
29616 0 : Py_DECREF(j);
29617 : return r;
29618 : }
29619 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
29620 : CYTHON_NCP_UNUSED int wraparound,
29621 : CYTHON_NCP_UNUSED int boundscheck) {
29622 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29623 : Py_ssize_t wrapped_i = i;
29624 : if (wraparound & unlikely(i < 0)) {
29625 : wrapped_i += PyList_GET_SIZE(o);
29626 : }
29627 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
29628 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
29629 : Py_INCREF(r);
29630 : return r;
29631 : }
29632 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29633 : #else
29634 : return PySequence_GetItem(o, i);
29635 : #endif
29636 : }
29637 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
29638 : CYTHON_NCP_UNUSED int wraparound,
29639 : CYTHON_NCP_UNUSED int boundscheck) {
29640 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29641 0 : Py_ssize_t wrapped_i = i;
29642 0 : if (wraparound & unlikely(i < 0)) {
29643 0 : wrapped_i += PyTuple_GET_SIZE(o);
29644 : }
29645 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29646 0 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29647 0 : Py_INCREF(r);
29648 0 : return r;
29649 : }
29650 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29651 : #else
29652 : return PySequence_GetItem(o, i);
29653 : #endif
29654 : }
29655 204 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29656 : CYTHON_NCP_UNUSED int wraparound,
29657 : CYTHON_NCP_UNUSED int boundscheck) {
29658 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29659 204 : if (is_list || PyList_CheckExact(o)) {
29660 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29661 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29662 0 : PyObject *r = PyList_GET_ITEM(o, n);
29663 0 : Py_INCREF(r);
29664 0 : return r;
29665 : }
29666 : }
29667 204 : else if (PyTuple_CheckExact(o)) {
29668 204 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29669 204 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29670 204 : PyObject *r = PyTuple_GET_ITEM(o, n);
29671 204 : Py_INCREF(r);
29672 204 : return r;
29673 : }
29674 : } else {
29675 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
29676 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
29677 0 : if (mm && mm->mp_subscript) {
29678 0 : PyObject *r, *key = PyInt_FromSsize_t(i);
29679 0 : if (unlikely(!key)) return NULL;
29680 0 : r = mm->mp_subscript(o, key);
29681 0 : Py_DECREF(key);
29682 0 : return r;
29683 : }
29684 0 : if (likely(sm && sm->sq_item)) {
29685 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
29686 0 : Py_ssize_t l = sm->sq_length(o);
29687 0 : if (likely(l >= 0)) {
29688 0 : i += l;
29689 : } else {
29690 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29691 : return NULL;
29692 0 : PyErr_Clear();
29693 : }
29694 : }
29695 0 : return sm->sq_item(o, i);
29696 : }
29697 : }
29698 : #else
29699 : if (is_list || !PyMapping_Check(o)) {
29700 : return PySequence_GetItem(o, i);
29701 : }
29702 : #endif
29703 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29704 : }
29705 :
29706 : /* PyObjectCallOneArg */
29707 18 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29708 18 : PyObject *args[2] = {NULL, arg};
29709 18 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
29710 : }
29711 :
29712 : /* ObjectGetItem */
29713 : #if CYTHON_USE_TYPE_SLOTS
29714 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
29715 0 : PyObject *runerr = NULL;
29716 0 : Py_ssize_t key_value;
29717 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
29718 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29719 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29720 : }
29721 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29722 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
29723 0 : PyErr_Clear();
29724 0 : PyErr_Format(PyExc_IndexError,
29725 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
29726 : __Pyx_DECREF_TypeName(index_type_name);
29727 : }
29728 : return NULL;
29729 : }
29730 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
29731 0 : __Pyx_TypeName obj_type_name;
29732 0 : if (likely(PyType_Check(obj))) {
29733 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
29734 0 : if (!meth) {
29735 0 : PyErr_Clear();
29736 : } else {
29737 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
29738 0 : Py_DECREF(meth);
29739 0 : return result;
29740 : }
29741 : }
29742 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29743 0 : PyErr_Format(PyExc_TypeError,
29744 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
29745 0 : __Pyx_DECREF_TypeName(obj_type_name);
29746 0 : return NULL;
29747 : }
29748 32 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
29749 32 : PyTypeObject *tp = Py_TYPE(obj);
29750 32 : PyMappingMethods *mm = tp->tp_as_mapping;
29751 32 : PySequenceMethods *sm = tp->tp_as_sequence;
29752 32 : if (likely(mm && mm->mp_subscript)) {
29753 32 : return mm->mp_subscript(obj, key);
29754 : }
29755 0 : if (likely(sm && sm->sq_item)) {
29756 0 : return __Pyx_PyObject_GetIndex(obj, key);
29757 : }
29758 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
29759 : }
29760 : #endif
29761 :
29762 : /* KeywordStringCheck */
29763 0 : static int __Pyx_CheckKeywordStrings(
29764 : PyObject *kw,
29765 : const char* function_name,
29766 : int kw_allowed)
29767 : {
29768 0 : PyObject* key = 0;
29769 0 : Py_ssize_t pos = 0;
29770 : #if CYTHON_COMPILING_IN_PYPY
29771 : if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
29772 : goto invalid_keyword;
29773 : return 1;
29774 : #else
29775 0 : if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
29776 0 : Py_ssize_t kwsize;
29777 : #if CYTHON_ASSUME_SAFE_MACROS
29778 0 : kwsize = PyTuple_GET_SIZE(kw);
29779 : #else
29780 : kwsize = PyTuple_Size(kw);
29781 : if (kwsize < 0) return 0;
29782 : #endif
29783 0 : if (unlikely(kwsize == 0))
29784 : return 1;
29785 0 : if (!kw_allowed) {
29786 : #if CYTHON_ASSUME_SAFE_MACROS
29787 0 : key = PyTuple_GET_ITEM(kw, 0);
29788 : #else
29789 : key = PyTuple_GetItem(kw, pos);
29790 : if (!key) return 0;
29791 : #endif
29792 0 : goto invalid_keyword;
29793 : }
29794 : #if PY_VERSION_HEX < 0x03090000
29795 : for (pos = 0; pos < kwsize; pos++) {
29796 : #if CYTHON_ASSUME_SAFE_MACROS
29797 : key = PyTuple_GET_ITEM(kw, pos);
29798 : #else
29799 : key = PyTuple_GetItem(kw, pos);
29800 : if (!key) return 0;
29801 : #endif
29802 : if (unlikely(!PyUnicode_Check(key)))
29803 : goto invalid_keyword_type;
29804 : }
29805 : #endif
29806 : return 1;
29807 : }
29808 0 : while (PyDict_Next(kw, &pos, &key, 0)) {
29809 : #if PY_MAJOR_VERSION < 3
29810 : if (unlikely(!PyString_Check(key)))
29811 : #endif
29812 0 : if (unlikely(!PyUnicode_Check(key)))
29813 0 : goto invalid_keyword_type;
29814 : }
29815 0 : if (!kw_allowed && unlikely(key))
29816 0 : goto invalid_keyword;
29817 : return 1;
29818 0 : invalid_keyword_type:
29819 0 : PyErr_Format(PyExc_TypeError,
29820 : "%.200s() keywords must be strings", function_name);
29821 0 : return 0;
29822 : #endif
29823 0 : invalid_keyword:
29824 : #if PY_MAJOR_VERSION < 3
29825 : PyErr_Format(PyExc_TypeError,
29826 : "%.200s() got an unexpected keyword argument '%.200s'",
29827 : function_name, PyString_AsString(key));
29828 : #else
29829 0 : PyErr_Format(PyExc_TypeError,
29830 : "%s() got an unexpected keyword argument '%U'",
29831 : function_name, key);
29832 : #endif
29833 0 : return 0;
29834 : }
29835 :
29836 : /* DivInt[Py_ssize_t] */
29837 0 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
29838 0 : Py_ssize_t q = a / b;
29839 0 : Py_ssize_t r = a - q*b;
29840 0 : q -= ((r != 0) & ((r ^ b) < 0));
29841 0 : return q;
29842 : }
29843 :
29844 : /* GetAttr3 */
29845 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
29846 0 : static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
29847 0 : __Pyx_PyThreadState_declare
29848 0 : __Pyx_PyThreadState_assign
29849 0 : if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
29850 : return NULL;
29851 0 : __Pyx_PyErr_Clear();
29852 0 : Py_INCREF(d);
29853 : return d;
29854 : }
29855 : #endif
29856 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
29857 0 : PyObject *r;
29858 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
29859 : int res = PyObject_GetOptionalAttr(o, n, &r);
29860 : return (res != 0) ? r : __Pyx_NewRef(d);
29861 : #else
29862 : #if CYTHON_USE_TYPE_SLOTS
29863 0 : if (likely(PyString_Check(n))) {
29864 0 : r = __Pyx_PyObject_GetAttrStrNoError(o, n);
29865 0 : if (unlikely(!r) && likely(!PyErr_Occurred())) {
29866 0 : r = __Pyx_NewRef(d);
29867 : }
29868 0 : return r;
29869 : }
29870 : #endif
29871 0 : r = PyObject_GetAttr(o, n);
29872 0 : return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
29873 : #endif
29874 : }
29875 :
29876 : /* PyDictVersioning */
29877 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
29878 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
29879 : PyObject *dict = Py_TYPE(obj)->tp_dict;
29880 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
29881 : }
29882 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
29883 : PyObject **dictptr = NULL;
29884 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
29885 : if (offset) {
29886 : #if CYTHON_COMPILING_IN_CPYTHON
29887 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
29888 : #else
29889 : dictptr = _PyObject_GetDictPtr(obj);
29890 : #endif
29891 : }
29892 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
29893 : }
29894 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
29895 : PyObject *dict = Py_TYPE(obj)->tp_dict;
29896 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
29897 : return 0;
29898 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
29899 : }
29900 : #endif
29901 :
29902 : /* GetModuleGlobalName */
29903 : #if CYTHON_USE_DICT_VERSIONS
29904 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
29905 : #else
29906 689 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
29907 : #endif
29908 : {
29909 689 : PyObject *result;
29910 : #if !CYTHON_AVOID_BORROWED_REFS
29911 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
29912 689 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
29913 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29914 689 : if (likely(result)) {
29915 1378 : return __Pyx_NewRef(result);
29916 0 : } else if (unlikely(PyErr_Occurred())) {
29917 : return NULL;
29918 : }
29919 : #elif CYTHON_COMPILING_IN_LIMITED_API
29920 : if (unlikely(!__pyx_m)) {
29921 : return NULL;
29922 : }
29923 : result = PyObject_GetAttr(__pyx_m, name);
29924 : if (likely(result)) {
29925 : return result;
29926 : }
29927 : #else
29928 : result = PyDict_GetItem(__pyx_d, name);
29929 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29930 : if (likely(result)) {
29931 : return __Pyx_NewRef(result);
29932 : }
29933 : #endif
29934 : #else
29935 : result = PyObject_GetItem(__pyx_d, name);
29936 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
29937 : if (likely(result)) {
29938 : return __Pyx_NewRef(result);
29939 : }
29940 : PyErr_Clear();
29941 : #endif
29942 0 : return __Pyx_GetBuiltinName(name);
29943 : }
29944 :
29945 : /* RaiseTooManyValuesToUnpack */
29946 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
29947 0 : PyErr_Format(PyExc_ValueError,
29948 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
29949 0 : }
29950 :
29951 : /* RaiseNeedMoreValuesToUnpack */
29952 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
29953 0 : PyErr_Format(PyExc_ValueError,
29954 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
29955 : index, (index == 1) ? "" : "s");
29956 0 : }
29957 :
29958 : /* RaiseNoneIterError */
29959 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
29960 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
29961 : }
29962 :
29963 : /* ExtTypeTest */
29964 0 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
29965 0 : __Pyx_TypeName obj_type_name;
29966 0 : __Pyx_TypeName type_name;
29967 0 : if (unlikely(!type)) {
29968 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
29969 0 : return 0;
29970 : }
29971 0 : if (likely(__Pyx_TypeCheck(obj, type)))
29972 : return 1;
29973 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
29974 0 : type_name = __Pyx_PyType_GetName(type);
29975 0 : PyErr_Format(PyExc_TypeError,
29976 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
29977 : obj_type_name, type_name);
29978 0 : __Pyx_DECREF_TypeName(obj_type_name);
29979 0 : __Pyx_DECREF_TypeName(type_name);
29980 0 : return 0;
29981 : }
29982 :
29983 : /* GetTopmostException */
29984 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
29985 : static _PyErr_StackItem *
29986 15 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29987 : {
29988 15 : _PyErr_StackItem *exc_info = tstate->exc_info;
29989 75 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
29990 75 : exc_info->previous_item != NULL)
29991 : {
29992 : exc_info = exc_info->previous_item;
29993 : }
29994 15 : return exc_info;
29995 : }
29996 : #endif
29997 :
29998 : /* SaveResetException */
29999 : #if CYTHON_FAST_THREAD_STATE
30000 15 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30001 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30002 15 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
30003 15 : PyObject *exc_value = exc_info->exc_value;
30004 15 : if (exc_value == NULL || exc_value == Py_None) {
30005 15 : *value = NULL;
30006 15 : *type = NULL;
30007 15 : *tb = NULL;
30008 : } else {
30009 0 : *value = exc_value;
30010 0 : Py_INCREF(*value);
30011 0 : *type = (PyObject*) Py_TYPE(exc_value);
30012 0 : Py_INCREF(*type);
30013 0 : *tb = PyException_GetTraceback(exc_value);
30014 : }
30015 : #elif CYTHON_USE_EXC_INFO_STACK
30016 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
30017 : *type = exc_info->exc_type;
30018 : *value = exc_info->exc_value;
30019 : *tb = exc_info->exc_traceback;
30020 : Py_XINCREF(*type);
30021 : Py_XINCREF(*value);
30022 : Py_XINCREF(*tb);
30023 : #else
30024 : *type = tstate->exc_type;
30025 : *value = tstate->exc_value;
30026 : *tb = tstate->exc_traceback;
30027 : Py_XINCREF(*type);
30028 : Py_XINCREF(*value);
30029 : Py_XINCREF(*tb);
30030 : #endif
30031 15 : }
30032 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
30033 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30034 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
30035 0 : PyObject *tmp_value = exc_info->exc_value;
30036 0 : exc_info->exc_value = value;
30037 0 : Py_XDECREF(tmp_value);
30038 0 : Py_XDECREF(type);
30039 0 : Py_XDECREF(tb);
30040 : #else
30041 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30042 : #if CYTHON_USE_EXC_INFO_STACK
30043 : _PyErr_StackItem *exc_info = tstate->exc_info;
30044 : tmp_type = exc_info->exc_type;
30045 : tmp_value = exc_info->exc_value;
30046 : tmp_tb = exc_info->exc_traceback;
30047 : exc_info->exc_type = type;
30048 : exc_info->exc_value = value;
30049 : exc_info->exc_traceback = tb;
30050 : #else
30051 : tmp_type = tstate->exc_type;
30052 : tmp_value = tstate->exc_value;
30053 : tmp_tb = tstate->exc_traceback;
30054 : tstate->exc_type = type;
30055 : tstate->exc_value = value;
30056 : tstate->exc_traceback = tb;
30057 : #endif
30058 : Py_XDECREF(tmp_type);
30059 : Py_XDECREF(tmp_value);
30060 : Py_XDECREF(tmp_tb);
30061 : #endif
30062 0 : }
30063 : #endif
30064 :
30065 : /* GetException */
30066 : #if CYTHON_FAST_THREAD_STATE
30067 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
30068 : #else
30069 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
30070 : #endif
30071 : {
30072 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
30073 : #if CYTHON_FAST_THREAD_STATE
30074 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30075 : #if PY_VERSION_HEX >= 0x030C00A6
30076 0 : local_value = tstate->current_exception;
30077 0 : tstate->current_exception = 0;
30078 0 : if (likely(local_value)) {
30079 0 : local_type = (PyObject*) Py_TYPE(local_value);
30080 0 : Py_INCREF(local_type);
30081 0 : local_tb = PyException_GetTraceback(local_value);
30082 : }
30083 : #else
30084 : local_type = tstate->curexc_type;
30085 : local_value = tstate->curexc_value;
30086 : local_tb = tstate->curexc_traceback;
30087 : tstate->curexc_type = 0;
30088 : tstate->curexc_value = 0;
30089 : tstate->curexc_traceback = 0;
30090 : #endif
30091 : #else
30092 : PyErr_Fetch(&local_type, &local_value, &local_tb);
30093 : #endif
30094 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
30095 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
30096 0 : if (unlikely(tstate->current_exception))
30097 : #elif CYTHON_FAST_THREAD_STATE
30098 : if (unlikely(tstate->curexc_type))
30099 : #else
30100 : if (unlikely(PyErr_Occurred()))
30101 : #endif
30102 0 : goto bad;
30103 : #if PY_MAJOR_VERSION >= 3
30104 0 : if (local_tb) {
30105 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
30106 0 : goto bad;
30107 : }
30108 : #endif
30109 0 : Py_XINCREF(local_tb);
30110 0 : Py_XINCREF(local_type);
30111 0 : Py_XINCREF(local_value);
30112 0 : *type = local_type;
30113 0 : *value = local_value;
30114 0 : *tb = local_tb;
30115 : #if CYTHON_FAST_THREAD_STATE
30116 : #if CYTHON_USE_EXC_INFO_STACK
30117 : {
30118 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
30119 : #if PY_VERSION_HEX >= 0x030B00a4
30120 0 : tmp_value = exc_info->exc_value;
30121 0 : exc_info->exc_value = local_value;
30122 0 : tmp_type = NULL;
30123 0 : tmp_tb = NULL;
30124 0 : Py_XDECREF(local_type);
30125 0 : Py_XDECREF(local_tb);
30126 : #else
30127 : tmp_type = exc_info->exc_type;
30128 : tmp_value = exc_info->exc_value;
30129 : tmp_tb = exc_info->exc_traceback;
30130 : exc_info->exc_type = local_type;
30131 : exc_info->exc_value = local_value;
30132 : exc_info->exc_traceback = local_tb;
30133 : #endif
30134 : }
30135 : #else
30136 : tmp_type = tstate->exc_type;
30137 : tmp_value = tstate->exc_value;
30138 : tmp_tb = tstate->exc_traceback;
30139 : tstate->exc_type = local_type;
30140 : tstate->exc_value = local_value;
30141 : tstate->exc_traceback = local_tb;
30142 : #endif
30143 0 : Py_XDECREF(tmp_type);
30144 0 : Py_XDECREF(tmp_value);
30145 0 : Py_XDECREF(tmp_tb);
30146 : #else
30147 : PyErr_SetExcInfo(local_type, local_value, local_tb);
30148 : #endif
30149 0 : return 0;
30150 0 : bad:
30151 0 : *type = 0;
30152 0 : *value = 0;
30153 0 : *tb = 0;
30154 0 : Py_XDECREF(local_type);
30155 0 : Py_XDECREF(local_value);
30156 0 : Py_XDECREF(local_tb);
30157 0 : return -1;
30158 : }
30159 :
30160 : /* SwapException */
30161 : #if CYTHON_FAST_THREAD_STATE
30162 0 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30163 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30164 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30165 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
30166 0 : tmp_value = exc_info->exc_value;
30167 0 : exc_info->exc_value = *value;
30168 0 : if (tmp_value == NULL || tmp_value == Py_None) {
30169 0 : Py_XDECREF(tmp_value);
30170 0 : tmp_value = NULL;
30171 0 : tmp_type = NULL;
30172 0 : tmp_tb = NULL;
30173 : } else {
30174 0 : tmp_type = (PyObject*) Py_TYPE(tmp_value);
30175 0 : Py_INCREF(tmp_type);
30176 : #if CYTHON_COMPILING_IN_CPYTHON
30177 0 : tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
30178 0 : Py_XINCREF(tmp_tb);
30179 : #else
30180 : tmp_tb = PyException_GetTraceback(tmp_value);
30181 : #endif
30182 : }
30183 : #elif CYTHON_USE_EXC_INFO_STACK
30184 : _PyErr_StackItem *exc_info = tstate->exc_info;
30185 : tmp_type = exc_info->exc_type;
30186 : tmp_value = exc_info->exc_value;
30187 : tmp_tb = exc_info->exc_traceback;
30188 : exc_info->exc_type = *type;
30189 : exc_info->exc_value = *value;
30190 : exc_info->exc_traceback = *tb;
30191 : #else
30192 : tmp_type = tstate->exc_type;
30193 : tmp_value = tstate->exc_value;
30194 : tmp_tb = tstate->exc_traceback;
30195 : tstate->exc_type = *type;
30196 : tstate->exc_value = *value;
30197 : tstate->exc_traceback = *tb;
30198 : #endif
30199 0 : *type = tmp_type;
30200 0 : *value = tmp_value;
30201 0 : *tb = tmp_tb;
30202 0 : }
30203 : #else
30204 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
30205 : PyObject *tmp_type, *tmp_value, *tmp_tb;
30206 : PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
30207 : PyErr_SetExcInfo(*type, *value, *tb);
30208 : *type = tmp_type;
30209 : *value = tmp_value;
30210 : *tb = tmp_tb;
30211 : }
30212 : #endif
30213 :
30214 : /* Import */
30215 9 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
30216 9 : PyObject *module = 0;
30217 9 : PyObject *empty_dict = 0;
30218 9 : PyObject *empty_list = 0;
30219 : #if PY_MAJOR_VERSION < 3
30220 : PyObject *py_import;
30221 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
30222 : if (unlikely(!py_import))
30223 : goto bad;
30224 : if (!from_list) {
30225 : empty_list = PyList_New(0);
30226 : if (unlikely(!empty_list))
30227 : goto bad;
30228 : from_list = empty_list;
30229 : }
30230 : #endif
30231 9 : empty_dict = PyDict_New();
30232 9 : if (unlikely(!empty_dict))
30233 0 : goto bad;
30234 : {
30235 : #if PY_MAJOR_VERSION >= 3
30236 9 : if (level == -1) {
30237 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
30238 0 : module = PyImport_ImportModuleLevelObject(
30239 0 : name, __pyx_d, empty_dict, from_list, 1);
30240 0 : if (unlikely(!module)) {
30241 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
30242 0 : goto bad;
30243 0 : PyErr_Clear();
30244 : }
30245 : }
30246 0 : level = 0;
30247 : }
30248 : #endif
30249 0 : if (!module) {
30250 : #if PY_MAJOR_VERSION < 3
30251 : PyObject *py_level = PyInt_FromLong(level);
30252 : if (unlikely(!py_level))
30253 : goto bad;
30254 : module = PyObject_CallFunctionObjArgs(py_import,
30255 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
30256 : Py_DECREF(py_level);
30257 : #else
30258 9 : module = PyImport_ImportModuleLevelObject(
30259 9 : name, __pyx_d, empty_dict, from_list, level);
30260 : #endif
30261 : }
30262 : }
30263 9 : bad:
30264 9 : Py_XDECREF(empty_dict);
30265 9 : Py_XDECREF(empty_list);
30266 : #if PY_MAJOR_VERSION < 3
30267 : Py_XDECREF(py_import);
30268 : #endif
30269 9 : return module;
30270 : }
30271 :
30272 : /* ImportDottedModule */
30273 : #if PY_MAJOR_VERSION >= 3
30274 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
30275 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
30276 0 : if (unlikely(PyErr_Occurred())) {
30277 0 : PyErr_Clear();
30278 : }
30279 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
30280 : partial_name = name;
30281 : } else {
30282 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
30283 0 : if (unlikely(!slice))
30284 0 : goto bad;
30285 0 : sep = PyUnicode_FromStringAndSize(".", 1);
30286 0 : if (unlikely(!sep))
30287 0 : goto bad;
30288 0 : partial_name = PyUnicode_Join(sep, slice);
30289 : }
30290 0 : PyErr_Format(
30291 : #if PY_MAJOR_VERSION < 3
30292 : PyExc_ImportError,
30293 : "No module named '%s'", PyString_AS_STRING(partial_name));
30294 : #else
30295 : #if PY_VERSION_HEX >= 0x030600B1
30296 : PyExc_ModuleNotFoundError,
30297 : #else
30298 : PyExc_ImportError,
30299 : #endif
30300 : "No module named '%U'", partial_name);
30301 : #endif
30302 0 : bad:
30303 0 : Py_XDECREF(sep);
30304 0 : Py_XDECREF(slice);
30305 0 : Py_XDECREF(partial_name);
30306 0 : return NULL;
30307 : }
30308 : #endif
30309 : #if PY_MAJOR_VERSION >= 3
30310 3 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
30311 3 : PyObject *imported_module;
30312 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
30313 : PyObject *modules = PyImport_GetModuleDict();
30314 : if (unlikely(!modules))
30315 : return NULL;
30316 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
30317 : Py_XINCREF(imported_module);
30318 : #else
30319 6 : imported_module = PyImport_GetModule(name);
30320 : #endif
30321 3 : return imported_module;
30322 : }
30323 : #endif
30324 : #if PY_MAJOR_VERSION >= 3
30325 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
30326 0 : Py_ssize_t i, nparts;
30327 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
30328 0 : for (i=1; i < nparts && module; i++) {
30329 0 : PyObject *part, *submodule;
30330 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30331 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
30332 : #else
30333 : part = PySequence_ITEM(parts_tuple, i);
30334 : #endif
30335 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
30336 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
30337 : Py_DECREF(part);
30338 : #endif
30339 0 : Py_DECREF(module);
30340 0 : module = submodule;
30341 : }
30342 0 : if (unlikely(!module)) {
30343 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
30344 : }
30345 : return module;
30346 : }
30347 : #endif
30348 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30349 : #if PY_MAJOR_VERSION < 3
30350 : PyObject *module, *from_list, *star = __pyx_n_s__3;
30351 : CYTHON_UNUSED_VAR(parts_tuple);
30352 : from_list = PyList_New(1);
30353 : if (unlikely(!from_list))
30354 : return NULL;
30355 : Py_INCREF(star);
30356 : PyList_SET_ITEM(from_list, 0, star);
30357 : module = __Pyx_Import(name, from_list, 0);
30358 : Py_DECREF(from_list);
30359 : return module;
30360 : #else
30361 0 : PyObject *imported_module;
30362 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
30363 0 : if (!parts_tuple || unlikely(!module))
30364 : return module;
30365 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
30366 0 : if (likely(imported_module)) {
30367 0 : Py_DECREF(module);
30368 0 : return imported_module;
30369 : }
30370 0 : PyErr_Clear();
30371 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
30372 : #endif
30373 : }
30374 3 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
30375 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
30376 3 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
30377 3 : if (likely(module)) {
30378 3 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
30379 3 : if (likely(spec)) {
30380 3 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
30381 3 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
30382 3 : Py_DECREF(spec);
30383 : spec = NULL;
30384 : }
30385 3 : Py_XDECREF(unsafe);
30386 : }
30387 3 : if (likely(!spec)) {
30388 3 : PyErr_Clear();
30389 3 : return module;
30390 : }
30391 0 : Py_DECREF(spec);
30392 0 : Py_DECREF(module);
30393 0 : } else if (PyErr_Occurred()) {
30394 0 : PyErr_Clear();
30395 : }
30396 : #endif
30397 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
30398 : }
30399 :
30400 : /* FastTypeChecks */
30401 : #if CYTHON_COMPILING_IN_CPYTHON
30402 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30403 0 : while (a) {
30404 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
30405 0 : if (a == b)
30406 : return 1;
30407 : }
30408 0 : return b == &PyBaseObject_Type;
30409 : }
30410 322 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30411 322 : PyObject *mro;
30412 322 : if (a == b) return 1;
30413 322 : mro = a->tp_mro;
30414 322 : if (likely(mro)) {
30415 322 : Py_ssize_t i, n;
30416 322 : n = PyTuple_GET_SIZE(mro);
30417 958 : for (i = 0; i < n; i++) {
30418 644 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30419 : return 1;
30420 : }
30421 : return 0;
30422 : }
30423 322 : return __Pyx_InBases(a, b);
30424 : }
30425 288 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
30426 288 : PyObject *mro;
30427 288 : if (cls == a || cls == b) return 1;
30428 176 : mro = cls->tp_mro;
30429 176 : if (likely(mro)) {
30430 176 : Py_ssize_t i, n;
30431 176 : n = PyTuple_GET_SIZE(mro);
30432 528 : for (i = 0; i < n; i++) {
30433 352 : PyObject *base = PyTuple_GET_ITEM(mro, i);
30434 352 : if (base == (PyObject *)a || base == (PyObject *)b)
30435 : return 1;
30436 : }
30437 : return 0;
30438 : }
30439 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
30440 : }
30441 : #if PY_MAJOR_VERSION == 2
30442 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30443 : PyObject *exception, *value, *tb;
30444 : int res;
30445 : __Pyx_PyThreadState_declare
30446 : __Pyx_PyThreadState_assign
30447 : __Pyx_ErrFetch(&exception, &value, &tb);
30448 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30449 : if (unlikely(res == -1)) {
30450 : PyErr_WriteUnraisable(err);
30451 : res = 0;
30452 : }
30453 : if (!res) {
30454 : res = PyObject_IsSubclass(err, exc_type2);
30455 : if (unlikely(res == -1)) {
30456 : PyErr_WriteUnraisable(err);
30457 : res = 0;
30458 : }
30459 : }
30460 : __Pyx_ErrRestore(exception, value, tb);
30461 : return res;
30462 : }
30463 : #else
30464 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30465 0 : if (exc_type1) {
30466 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
30467 : } else {
30468 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30469 : }
30470 : }
30471 : #endif
30472 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30473 0 : Py_ssize_t i, n;
30474 0 : assert(PyExceptionClass_Check(exc_type));
30475 0 : n = PyTuple_GET_SIZE(tuple);
30476 : #if PY_MAJOR_VERSION >= 3
30477 0 : for (i=0; i<n; i++) {
30478 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30479 : }
30480 : #endif
30481 0 : for (i=0; i<n; i++) {
30482 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
30483 : #if PY_MAJOR_VERSION < 3
30484 : if (likely(exc_type == t)) return 1;
30485 : #endif
30486 0 : if (likely(PyExceptionClass_Check(t))) {
30487 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30488 : } else {
30489 0 : }
30490 : }
30491 : return 0;
30492 : }
30493 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30494 0 : if (likely(err == exc_type)) return 1;
30495 0 : if (likely(PyExceptionClass_Check(err))) {
30496 0 : if (likely(PyExceptionClass_Check(exc_type))) {
30497 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30498 0 : } else if (likely(PyTuple_Check(exc_type))) {
30499 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30500 : } else {
30501 0 : }
30502 : }
30503 0 : return PyErr_GivenExceptionMatches(err, exc_type);
30504 : }
30505 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30506 : assert(PyExceptionClass_Check(exc_type1));
30507 : assert(PyExceptionClass_Check(exc_type2));
30508 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
30509 : if (likely(PyExceptionClass_Check(err))) {
30510 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30511 : }
30512 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30513 : }
30514 : #endif
30515 :
30516 : /* PySequenceMultiply */
30517 0 : static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
30518 0 : PyObject *result, *pymul = PyInt_FromSsize_t(mul);
30519 0 : if (unlikely(!pymul))
30520 : return NULL;
30521 0 : result = PyNumber_Multiply(seq, pymul);
30522 0 : Py_DECREF(pymul);
30523 : return result;
30524 : }
30525 0 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
30526 : #if CYTHON_USE_TYPE_SLOTS
30527 0 : PyTypeObject *type = Py_TYPE(seq);
30528 0 : if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
30529 0 : return type->tp_as_sequence->sq_repeat(seq, mul);
30530 : } else
30531 : #endif
30532 : {
30533 0 : return __Pyx_PySequence_Multiply_Generic(seq, mul);
30534 : }
30535 : }
30536 :
30537 : /* SetItemInt */
30538 0 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
30539 0 : int r;
30540 0 : if (unlikely(!j)) return -1;
30541 0 : r = PyObject_SetItem(o, j, v);
30542 0 : Py_DECREF(j);
30543 : return r;
30544 : }
30545 0 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
30546 : CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
30547 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
30548 0 : if (is_list || PyList_CheckExact(o)) {
30549 0 : Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
30550 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
30551 0 : PyObject* old = PyList_GET_ITEM(o, n);
30552 0 : Py_INCREF(v);
30553 0 : PyList_SET_ITEM(o, n, v);
30554 0 : Py_DECREF(old);
30555 0 : return 1;
30556 : }
30557 : } else {
30558 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
30559 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
30560 0 : if (mm && mm->mp_ass_subscript) {
30561 0 : int r;
30562 0 : PyObject *key = PyInt_FromSsize_t(i);
30563 0 : if (unlikely(!key)) return -1;
30564 0 : r = mm->mp_ass_subscript(o, key, v);
30565 0 : Py_DECREF(key);
30566 0 : return r;
30567 : }
30568 0 : if (likely(sm && sm->sq_ass_item)) {
30569 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
30570 0 : Py_ssize_t l = sm->sq_length(o);
30571 0 : if (likely(l >= 0)) {
30572 0 : i += l;
30573 : } else {
30574 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
30575 : return -1;
30576 0 : PyErr_Clear();
30577 : }
30578 : }
30579 0 : return sm->sq_ass_item(o, i, v);
30580 : }
30581 : }
30582 : #else
30583 : if (is_list || !PyMapping_Check(o))
30584 : {
30585 : return PySequence_SetItem(o, i, v);
30586 : }
30587 : #endif
30588 0 : return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
30589 : }
30590 :
30591 : /* RaiseUnboundLocalError */
30592 0 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
30593 0 : PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
30594 : }
30595 :
30596 : /* DivInt[long] */
30597 0 : static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
30598 0 : long q = a / b;
30599 0 : long r = a - q*b;
30600 0 : q -= ((r != 0) & ((r ^ b) < 0));
30601 0 : return q;
30602 : }
30603 :
30604 : /* ImportFrom */
30605 18 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30606 18 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30607 18 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30608 0 : const char* module_name_str = 0;
30609 0 : PyObject* module_name = 0;
30610 0 : PyObject* module_dot = 0;
30611 0 : PyObject* full_name = 0;
30612 0 : PyErr_Clear();
30613 0 : module_name_str = PyModule_GetName(module);
30614 0 : if (unlikely(!module_name_str)) { goto modbad; }
30615 0 : module_name = PyUnicode_FromString(module_name_str);
30616 0 : if (unlikely(!module_name)) { goto modbad; }
30617 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2);
30618 0 : if (unlikely(!module_dot)) { goto modbad; }
30619 0 : full_name = PyUnicode_Concat(module_dot, name);
30620 0 : if (unlikely(!full_name)) { goto modbad; }
30621 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
30622 : {
30623 : PyObject *modules = PyImport_GetModuleDict();
30624 : if (unlikely(!modules))
30625 : goto modbad;
30626 : value = PyObject_GetItem(modules, full_name);
30627 : }
30628 : #else
30629 0 : value = PyImport_GetModule(full_name);
30630 : #endif
30631 0 : modbad:
30632 0 : Py_XDECREF(full_name);
30633 0 : Py_XDECREF(module_dot);
30634 0 : Py_XDECREF(module_name);
30635 : }
30636 18 : if (unlikely(!value)) {
30637 0 : PyErr_Format(PyExc_ImportError,
30638 : #if PY_MAJOR_VERSION < 3
30639 : "cannot import name %.230s", PyString_AS_STRING(name));
30640 : #else
30641 : "cannot import name %S", name);
30642 : #endif
30643 : }
30644 18 : return value;
30645 : }
30646 :
30647 : /* HasAttr */
30648 0 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
30649 0 : PyObject *r;
30650 0 : if (unlikely(!__Pyx_PyBaseString_Check(n))) {
30651 0 : PyErr_SetString(PyExc_TypeError,
30652 : "hasattr(): attribute name must be string");
30653 0 : return -1;
30654 : }
30655 0 : r = __Pyx_GetAttr(o, n);
30656 0 : if (!r) {
30657 0 : PyErr_Clear();
30658 0 : return 0;
30659 : } else {
30660 0 : Py_DECREF(r);
30661 0 : return 1;
30662 : }
30663 : }
30664 :
30665 : /* PyObjectSetAttrStr */
30666 : #if CYTHON_USE_TYPE_SLOTS
30667 32 : static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
30668 32 : PyTypeObject* tp = Py_TYPE(obj);
30669 32 : if (likely(tp->tp_setattro))
30670 32 : return tp->tp_setattro(obj, attr_name, value);
30671 : #if PY_MAJOR_VERSION < 3
30672 : if (likely(tp->tp_setattr))
30673 : return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
30674 : #endif
30675 0 : return PyObject_SetAttr(obj, attr_name, value);
30676 : }
30677 : #endif
30678 :
30679 : /* PyIntBinop */
30680 : #if !CYTHON_COMPILING_IN_PYPY
30681 12 : static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
30682 12 : CYTHON_MAYBE_UNUSED_VAR(intval);
30683 12 : CYTHON_MAYBE_UNUSED_VAR(inplace);
30684 12 : CYTHON_UNUSED_VAR(zerodivision_check);
30685 : #if PY_MAJOR_VERSION < 3
30686 : if (likely(PyInt_CheckExact(op1))) {
30687 : const long b = intval;
30688 : long x;
30689 : long a = PyInt_AS_LONG(op1);
30690 :
30691 : x = (long)((unsigned long)a - (unsigned long)b);
30692 : if (likely((x^a) >= 0 || (x^~b) >= 0))
30693 : return PyInt_FromLong(x);
30694 : return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
30695 : }
30696 : #endif
30697 : #if CYTHON_USE_PYLONG_INTERNALS
30698 12 : if (likely(PyLong_CheckExact(op1))) {
30699 12 : const long b = intval;
30700 12 : long a, x;
30701 : #ifdef HAVE_LONG_LONG
30702 12 : const PY_LONG_LONG llb = intval;
30703 12 : PY_LONG_LONG lla, llx;
30704 : #endif
30705 12 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
30706 0 : return PyLong_FromLong(-intval);
30707 : }
30708 12 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
30709 12 : a = __Pyx_PyLong_CompactValue(op1);
30710 : } else {
30711 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
30712 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
30713 0 : switch (size) {
30714 : case -2:
30715 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30716 0 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30717 0 : break;
30718 : #ifdef HAVE_LONG_LONG
30719 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30720 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30721 : goto long_long;
30722 : #endif
30723 : }
30724 0 : CYTHON_FALLTHROUGH;
30725 : case 2:
30726 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30727 0 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30728 0 : break;
30729 : #ifdef HAVE_LONG_LONG
30730 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30731 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30732 : goto long_long;
30733 : #endif
30734 : }
30735 : CYTHON_FALLTHROUGH;
30736 : case -3:
30737 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30738 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30739 : break;
30740 : #ifdef HAVE_LONG_LONG
30741 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30742 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30743 : goto long_long;
30744 : #endif
30745 : }
30746 : CYTHON_FALLTHROUGH;
30747 : case 3:
30748 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30749 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30750 : break;
30751 : #ifdef HAVE_LONG_LONG
30752 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30753 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30754 : goto long_long;
30755 : #endif
30756 : }
30757 : CYTHON_FALLTHROUGH;
30758 : case -4:
30759 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30760 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30761 : break;
30762 : #ifdef HAVE_LONG_LONG
30763 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30764 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30765 : goto long_long;
30766 : #endif
30767 : }
30768 : CYTHON_FALLTHROUGH;
30769 : case 4:
30770 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30771 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30772 : break;
30773 : #ifdef HAVE_LONG_LONG
30774 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30775 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30776 : goto long_long;
30777 : #endif
30778 : }
30779 0 : CYTHON_FALLTHROUGH;
30780 0 : default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
30781 : }
30782 : }
30783 12 : x = a - b;
30784 12 : return PyLong_FromLong(x);
30785 : #ifdef HAVE_LONG_LONG
30786 : long_long:
30787 : llx = lla - llb;
30788 : return PyLong_FromLongLong(llx);
30789 : #endif
30790 :
30791 :
30792 : }
30793 : #endif
30794 0 : if (PyFloat_CheckExact(op1)) {
30795 0 : const long b = intval;
30796 : #if CYTHON_COMPILING_IN_LIMITED_API
30797 : double a = __pyx_PyFloat_AsDouble(op1);
30798 : #else
30799 0 : double a = PyFloat_AS_DOUBLE(op1);
30800 : #endif
30801 0 : double result;
30802 :
30803 : PyFPE_START_PROTECT("subtract", return NULL)
30804 0 : result = ((double)a) - (double)b;
30805 : PyFPE_END_PROTECT(result)
30806 0 : return PyFloat_FromDouble(result);
30807 : }
30808 0 : return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
30809 : }
30810 : #endif
30811 :
30812 : /* IterFinish */
30813 0 : static CYTHON_INLINE int __Pyx_IterFinish(void) {
30814 0 : PyObject* exc_type;
30815 0 : __Pyx_PyThreadState_declare
30816 0 : __Pyx_PyThreadState_assign
30817 0 : exc_type = __Pyx_PyErr_CurrentExceptionType();
30818 0 : if (unlikely(exc_type)) {
30819 0 : if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
30820 : return -1;
30821 0 : __Pyx_PyErr_Clear();
30822 0 : return 0;
30823 : }
30824 : return 0;
30825 : }
30826 :
30827 : /* UnpackItemEndCheck */
30828 0 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
30829 0 : if (unlikely(retval)) {
30830 0 : Py_DECREF(retval);
30831 0 : __Pyx_RaiseTooManyValuesError(expected);
30832 0 : return -1;
30833 : }
30834 0 : return __Pyx_IterFinish();
30835 : }
30836 :
30837 : /* PyIntBinop */
30838 : #if !CYTHON_COMPILING_IN_PYPY
30839 16 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
30840 16 : CYTHON_MAYBE_UNUSED_VAR(intval);
30841 16 : CYTHON_MAYBE_UNUSED_VAR(inplace);
30842 16 : CYTHON_UNUSED_VAR(zerodivision_check);
30843 : #if PY_MAJOR_VERSION < 3
30844 : if (likely(PyInt_CheckExact(op1))) {
30845 : const long b = intval;
30846 : long x;
30847 : long a = PyInt_AS_LONG(op1);
30848 :
30849 : x = (long)((unsigned long)a + (unsigned long)b);
30850 : if (likely((x^a) >= 0 || (x^b) >= 0))
30851 : return PyInt_FromLong(x);
30852 : return PyLong_Type.tp_as_number->nb_add(op1, op2);
30853 : }
30854 : #endif
30855 : #if CYTHON_USE_PYLONG_INTERNALS
30856 16 : if (likely(PyLong_CheckExact(op1))) {
30857 16 : const long b = intval;
30858 16 : long a, x;
30859 : #ifdef HAVE_LONG_LONG
30860 16 : const PY_LONG_LONG llb = intval;
30861 16 : PY_LONG_LONG lla, llx;
30862 : #endif
30863 16 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
30864 16 : return __Pyx_NewRef(op2);
30865 : }
30866 0 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
30867 0 : a = __Pyx_PyLong_CompactValue(op1);
30868 : } else {
30869 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
30870 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
30871 0 : switch (size) {
30872 : case -2:
30873 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30874 0 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30875 0 : break;
30876 : #ifdef HAVE_LONG_LONG
30877 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30878 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30879 : goto long_long;
30880 : #endif
30881 : }
30882 0 : CYTHON_FALLTHROUGH;
30883 : case 2:
30884 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30885 0 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30886 0 : break;
30887 : #ifdef HAVE_LONG_LONG
30888 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30889 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30890 : goto long_long;
30891 : #endif
30892 : }
30893 : CYTHON_FALLTHROUGH;
30894 : case -3:
30895 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30896 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30897 : break;
30898 : #ifdef HAVE_LONG_LONG
30899 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30900 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30901 : goto long_long;
30902 : #endif
30903 : }
30904 : CYTHON_FALLTHROUGH;
30905 : case 3:
30906 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30907 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30908 : break;
30909 : #ifdef HAVE_LONG_LONG
30910 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30911 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30912 : goto long_long;
30913 : #endif
30914 : }
30915 : CYTHON_FALLTHROUGH;
30916 : case -4:
30917 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30918 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30919 : break;
30920 : #ifdef HAVE_LONG_LONG
30921 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30922 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30923 : goto long_long;
30924 : #endif
30925 : }
30926 : CYTHON_FALLTHROUGH;
30927 : case 4:
30928 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30929 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30930 : break;
30931 : #ifdef HAVE_LONG_LONG
30932 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30933 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30934 : goto long_long;
30935 : #endif
30936 : }
30937 0 : CYTHON_FALLTHROUGH;
30938 0 : default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
30939 : }
30940 : }
30941 0 : x = a + b;
30942 0 : return PyLong_FromLong(x);
30943 : #ifdef HAVE_LONG_LONG
30944 : long_long:
30945 : llx = lla + llb;
30946 : return PyLong_FromLongLong(llx);
30947 : #endif
30948 :
30949 :
30950 : }
30951 : #endif
30952 0 : if (PyFloat_CheckExact(op1)) {
30953 0 : const long b = intval;
30954 : #if CYTHON_COMPILING_IN_LIMITED_API
30955 : double a = __pyx_PyFloat_AsDouble(op1);
30956 : #else
30957 0 : double a = PyFloat_AS_DOUBLE(op1);
30958 : #endif
30959 0 : double result;
30960 :
30961 : PyFPE_START_PROTECT("add", return NULL)
30962 0 : result = ((double)a) + (double)b;
30963 : PyFPE_END_PROTECT(result)
30964 0 : return PyFloat_FromDouble(result);
30965 : }
30966 0 : return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30967 : }
30968 : #endif
30969 :
30970 : /* SliceObject */
30971 16 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
30972 : Py_ssize_t cstart, Py_ssize_t cstop,
30973 : PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
30974 : int has_cstart, int has_cstop, int wraparound) {
30975 16 : __Pyx_TypeName obj_type_name;
30976 : #if CYTHON_USE_TYPE_SLOTS
30977 16 : PyMappingMethods* mp;
30978 : #if PY_MAJOR_VERSION < 3
30979 : PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
30980 : if (likely(ms && ms->sq_slice)) {
30981 : if (!has_cstart) {
30982 : if (_py_start && (*_py_start != Py_None)) {
30983 : cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
30984 : if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
30985 : } else
30986 : cstart = 0;
30987 : }
30988 : if (!has_cstop) {
30989 : if (_py_stop && (*_py_stop != Py_None)) {
30990 : cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
30991 : if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
30992 : } else
30993 : cstop = PY_SSIZE_T_MAX;
30994 : }
30995 : if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
30996 : Py_ssize_t l = ms->sq_length(obj);
30997 : if (likely(l >= 0)) {
30998 : if (cstop < 0) {
30999 : cstop += l;
31000 : if (cstop < 0) cstop = 0;
31001 : }
31002 : if (cstart < 0) {
31003 : cstart += l;
31004 : if (cstart < 0) cstart = 0;
31005 : }
31006 : } else {
31007 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
31008 : goto bad;
31009 : PyErr_Clear();
31010 : }
31011 : }
31012 : return ms->sq_slice(obj, cstart, cstop);
31013 : }
31014 : #else
31015 16 : CYTHON_UNUSED_VAR(wraparound);
31016 : #endif
31017 16 : mp = Py_TYPE(obj)->tp_as_mapping;
31018 16 : if (likely(mp && mp->mp_subscript))
31019 : #else
31020 : CYTHON_UNUSED_VAR(wraparound);
31021 : #endif
31022 : {
31023 16 : PyObject* result;
31024 16 : PyObject *py_slice, *py_start, *py_stop;
31025 16 : if (_py_slice) {
31026 0 : py_slice = *_py_slice;
31027 : } else {
31028 16 : PyObject* owned_start = NULL;
31029 16 : PyObject* owned_stop = NULL;
31030 16 : if (_py_start) {
31031 16 : py_start = *_py_start;
31032 : } else {
31033 0 : if (has_cstart) {
31034 0 : owned_start = py_start = PyInt_FromSsize_t(cstart);
31035 0 : if (unlikely(!py_start)) goto bad;
31036 : } else
31037 : py_start = Py_None;
31038 : }
31039 16 : if (_py_stop) {
31040 16 : py_stop = *_py_stop;
31041 : } else {
31042 0 : if (has_cstop) {
31043 0 : owned_stop = py_stop = PyInt_FromSsize_t(cstop);
31044 0 : if (unlikely(!py_stop)) {
31045 0 : Py_XDECREF(owned_start);
31046 0 : goto bad;
31047 : }
31048 : } else
31049 : py_stop = Py_None;
31050 : }
31051 16 : py_slice = PySlice_New(py_start, py_stop, Py_None);
31052 16 : Py_XDECREF(owned_start);
31053 16 : Py_XDECREF(owned_stop);
31054 16 : if (unlikely(!py_slice)) goto bad;
31055 : }
31056 : #if CYTHON_USE_TYPE_SLOTS
31057 16 : result = mp->mp_subscript(obj, py_slice);
31058 : #else
31059 : result = PyObject_GetItem(obj, py_slice);
31060 : #endif
31061 16 : if (!_py_slice) {
31062 16 : Py_DECREF(py_slice);
31063 : }
31064 16 : return result;
31065 : }
31066 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
31067 0 : PyErr_Format(PyExc_TypeError,
31068 : "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
31069 : __Pyx_DECREF_TypeName(obj_type_name);
31070 : bad:
31071 : return NULL;
31072 : }
31073 :
31074 : /* PyIntBinop */
31075 : #if !CYTHON_COMPILING_IN_PYPY
31076 40 : static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
31077 40 : CYTHON_MAYBE_UNUSED_VAR(intval);
31078 40 : CYTHON_MAYBE_UNUSED_VAR(inplace);
31079 40 : CYTHON_UNUSED_VAR(zerodivision_check);
31080 : #if PY_MAJOR_VERSION < 3
31081 : if (likely(PyInt_CheckExact(op2))) {
31082 : const long a = intval;
31083 : long b = PyInt_AS_LONG(op2);
31084 :
31085 : #ifdef HAVE_LONG_LONG
31086 : if (sizeof(PY_LONG_LONG) > sizeof(long)) {
31087 : PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b;
31088 : return (result >= LONG_MIN && result <= LONG_MAX) ?
31089 : PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
31090 : }
31091 : #endif
31092 : #if CYTHON_USE_TYPE_SLOTS
31093 : return PyInt_Type.tp_as_number->nb_multiply(op1, op2);
31094 : #else
31095 : return PyNumber_Multiply(op1, op2);
31096 : #endif
31097 : }
31098 : #endif
31099 : #if CYTHON_USE_PYLONG_INTERNALS
31100 40 : if (likely(PyLong_CheckExact(op2))) {
31101 40 : const long a = intval;
31102 40 : long b, x;
31103 : #ifdef HAVE_LONG_LONG
31104 40 : const PY_LONG_LONG lla = intval;
31105 40 : PY_LONG_LONG llb, llx;
31106 : #endif
31107 40 : if (unlikely(__Pyx_PyLong_IsZero(op2))) {
31108 4 : return __Pyx_NewRef(op2);
31109 : }
31110 36 : if (likely(__Pyx_PyLong_IsCompact(op2))) {
31111 36 : b = __Pyx_PyLong_CompactValue(op2);
31112 : } else {
31113 0 : const digit* digits = __Pyx_PyLong_Digits(op2);
31114 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
31115 0 : switch (size) {
31116 : case -2:
31117 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
31118 : b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31119 : break;
31120 : #ifdef HAVE_LONG_LONG
31121 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
31122 : llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31123 : goto long_long;
31124 : #endif
31125 : }
31126 : CYTHON_FALLTHROUGH;
31127 : case 2:
31128 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
31129 : b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31130 : break;
31131 : #ifdef HAVE_LONG_LONG
31132 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
31133 : llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31134 : goto long_long;
31135 : #endif
31136 : }
31137 : CYTHON_FALLTHROUGH;
31138 : case -3:
31139 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
31140 : b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31141 : break;
31142 : #ifdef HAVE_LONG_LONG
31143 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
31144 : llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31145 : goto long_long;
31146 : #endif
31147 : }
31148 : CYTHON_FALLTHROUGH;
31149 : case 3:
31150 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
31151 : b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31152 : break;
31153 : #ifdef HAVE_LONG_LONG
31154 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
31155 : llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31156 : goto long_long;
31157 : #endif
31158 : }
31159 : CYTHON_FALLTHROUGH;
31160 : case -4:
31161 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
31162 : b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31163 : break;
31164 : #ifdef HAVE_LONG_LONG
31165 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
31166 : llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31167 : goto long_long;
31168 : #endif
31169 : }
31170 0 : CYTHON_FALLTHROUGH;
31171 : case 4:
31172 0 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
31173 : b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
31174 : break;
31175 : #ifdef HAVE_LONG_LONG
31176 0 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
31177 : llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
31178 : goto long_long;
31179 : #endif
31180 : }
31181 0 : CYTHON_FALLTHROUGH;
31182 0 : default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
31183 : }
31184 : }
31185 36 : CYTHON_UNUSED_VAR(a);
31186 36 : CYTHON_UNUSED_VAR(b);
31187 : #ifdef HAVE_LONG_LONG
31188 36 : llb = b;
31189 36 : goto long_long;
31190 : #else
31191 : return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
31192 : #endif
31193 : return PyLong_FromLong(x);
31194 : #ifdef HAVE_LONG_LONG
31195 36 : long_long:
31196 36 : llx = lla * llb;
31197 36 : return PyLong_FromLongLong(llx);
31198 : #endif
31199 :
31200 :
31201 : }
31202 : #endif
31203 0 : if (PyFloat_CheckExact(op2)) {
31204 0 : const long a = intval;
31205 : #if CYTHON_COMPILING_IN_LIMITED_API
31206 : double b = __pyx_PyFloat_AsDouble(op2);
31207 : #else
31208 0 : double b = PyFloat_AS_DOUBLE(op2);
31209 : #endif
31210 0 : double result;
31211 :
31212 : PyFPE_START_PROTECT("multiply", return NULL)
31213 0 : result = ((double)a) * (double)b;
31214 : PyFPE_END_PROTECT(result)
31215 0 : return PyFloat_FromDouble(result);
31216 : }
31217 0 : return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
31218 : }
31219 : #endif
31220 :
31221 : /* PyObject_GenericGetAttrNoDict */
31222 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
31223 : static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
31224 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
31225 : PyErr_Format(PyExc_AttributeError,
31226 : #if PY_MAJOR_VERSION >= 3
31227 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
31228 : type_name, attr_name);
31229 : #else
31230 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
31231 : type_name, PyString_AS_STRING(attr_name));
31232 : #endif
31233 : __Pyx_DECREF_TypeName(type_name);
31234 : return NULL;
31235 : }
31236 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
31237 : PyObject *descr;
31238 : PyTypeObject *tp = Py_TYPE(obj);
31239 : if (unlikely(!PyString_Check(attr_name))) {
31240 : return PyObject_GenericGetAttr(obj, attr_name);
31241 : }
31242 : assert(!tp->tp_dictoffset);
31243 : descr = _PyType_Lookup(tp, attr_name);
31244 : if (unlikely(!descr)) {
31245 : return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
31246 : }
31247 : Py_INCREF(descr);
31248 : #if PY_MAJOR_VERSION < 3
31249 : if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
31250 : #endif
31251 : {
31252 : descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
31253 : if (unlikely(f)) {
31254 : PyObject *res = f(descr, obj, (PyObject *)tp);
31255 : Py_DECREF(descr);
31256 : return res;
31257 : }
31258 : }
31259 : return descr;
31260 : }
31261 : #endif
31262 :
31263 : /* PyObject_GenericGetAttr */
31264 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
31265 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
31266 : if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
31267 : return PyObject_GenericGetAttr(obj, attr_name);
31268 : }
31269 : return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
31270 : }
31271 : #endif
31272 :
31273 : /* FixUpExtensionType */
31274 : #if CYTHON_USE_TYPE_SPECS
31275 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
31276 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
31277 : CYTHON_UNUSED_VAR(spec);
31278 : CYTHON_UNUSED_VAR(type);
31279 : #else
31280 : const PyType_Slot *slot = spec->slots;
31281 : while (slot && slot->slot && slot->slot != Py_tp_members)
31282 : slot++;
31283 : if (slot && slot->slot == Py_tp_members) {
31284 : int changed = 0;
31285 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
31286 : const
31287 : #endif
31288 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
31289 : while (memb && memb->name) {
31290 : if (memb->name[0] == '_' && memb->name[1] == '_') {
31291 : #if PY_VERSION_HEX < 0x030900b1
31292 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
31293 : assert(memb->type == T_PYSSIZET);
31294 : assert(memb->flags == READONLY);
31295 : type->tp_weaklistoffset = memb->offset;
31296 : changed = 1;
31297 : }
31298 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
31299 : assert(memb->type == T_PYSSIZET);
31300 : assert(memb->flags == READONLY);
31301 : type->tp_dictoffset = memb->offset;
31302 : changed = 1;
31303 : }
31304 : #if CYTHON_METH_FASTCALL
31305 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
31306 : assert(memb->type == T_PYSSIZET);
31307 : assert(memb->flags == READONLY);
31308 : #if PY_VERSION_HEX >= 0x030800b4
31309 : type->tp_vectorcall_offset = memb->offset;
31310 : #else
31311 : type->tp_print = (printfunc) memb->offset;
31312 : #endif
31313 : changed = 1;
31314 : }
31315 : #endif
31316 : #else
31317 : if ((0));
31318 : #endif
31319 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
31320 : else if (strcmp(memb->name, "__module__") == 0) {
31321 : PyObject *descr;
31322 : assert(memb->type == T_OBJECT);
31323 : assert(memb->flags == 0 || memb->flags == READONLY);
31324 : descr = PyDescr_NewMember(type, memb);
31325 : if (unlikely(!descr))
31326 : return -1;
31327 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
31328 : Py_DECREF(descr);
31329 : return -1;
31330 : }
31331 : Py_DECREF(descr);
31332 : changed = 1;
31333 : }
31334 : #endif
31335 : }
31336 : memb++;
31337 : }
31338 : if (changed)
31339 : PyType_Modified(type);
31340 : }
31341 : #endif
31342 : return 0;
31343 : }
31344 : #endif
31345 :
31346 : /* PyObjectCallNoArg */
31347 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
31348 : PyObject *arg[2] = {NULL, NULL};
31349 : return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
31350 : }
31351 :
31352 : /* PyObjectGetMethod */
31353 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
31354 : PyObject *attr;
31355 : #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
31356 : __Pyx_TypeName type_name;
31357 : PyTypeObject *tp = Py_TYPE(obj);
31358 : PyObject *descr;
31359 : descrgetfunc f = NULL;
31360 : PyObject **dictptr, *dict;
31361 : int meth_found = 0;
31362 : assert (*method == NULL);
31363 : if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
31364 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
31365 : goto try_unpack;
31366 : }
31367 : if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
31368 : return 0;
31369 : }
31370 : descr = _PyType_Lookup(tp, name);
31371 : if (likely(descr != NULL)) {
31372 : Py_INCREF(descr);
31373 : #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
31374 : if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
31375 : #elif PY_MAJOR_VERSION >= 3
31376 : #ifdef __Pyx_CyFunction_USED
31377 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
31378 : #else
31379 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
31380 : #endif
31381 : #else
31382 : #ifdef __Pyx_CyFunction_USED
31383 : if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
31384 : #else
31385 : if (likely(PyFunction_Check(descr)))
31386 : #endif
31387 : #endif
31388 : {
31389 : meth_found = 1;
31390 : } else {
31391 : f = Py_TYPE(descr)->tp_descr_get;
31392 : if (f != NULL && PyDescr_IsData(descr)) {
31393 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
31394 : Py_DECREF(descr);
31395 : goto try_unpack;
31396 : }
31397 : }
31398 : }
31399 : dictptr = _PyObject_GetDictPtr(obj);
31400 : if (dictptr != NULL && (dict = *dictptr) != NULL) {
31401 : Py_INCREF(dict);
31402 : attr = __Pyx_PyDict_GetItemStr(dict, name);
31403 : if (attr != NULL) {
31404 : Py_INCREF(attr);
31405 : Py_DECREF(dict);
31406 : Py_XDECREF(descr);
31407 : goto try_unpack;
31408 : }
31409 : Py_DECREF(dict);
31410 : }
31411 : if (meth_found) {
31412 : *method = descr;
31413 : return 1;
31414 : }
31415 : if (f != NULL) {
31416 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
31417 : Py_DECREF(descr);
31418 : goto try_unpack;
31419 : }
31420 : if (likely(descr != NULL)) {
31421 : *method = descr;
31422 : return 0;
31423 : }
31424 : type_name = __Pyx_PyType_GetName(tp);
31425 : PyErr_Format(PyExc_AttributeError,
31426 : #if PY_MAJOR_VERSION >= 3
31427 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
31428 : type_name, name);
31429 : #else
31430 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
31431 : type_name, PyString_AS_STRING(name));
31432 : #endif
31433 : __Pyx_DECREF_TypeName(type_name);
31434 : return 0;
31435 : #else
31436 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
31437 : goto try_unpack;
31438 : #endif
31439 : try_unpack:
31440 : #if CYTHON_UNPACK_METHODS
31441 : if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
31442 : PyObject *function = PyMethod_GET_FUNCTION(attr);
31443 : Py_INCREF(function);
31444 : Py_DECREF(attr);
31445 : *method = function;
31446 : return 1;
31447 : }
31448 : #endif
31449 : *method = attr;
31450 : return 0;
31451 : }
31452 :
31453 : /* PyObjectCallMethod0 */
31454 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
31455 : PyObject *method = NULL, *result = NULL;
31456 : int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
31457 : if (likely(is_method)) {
31458 : result = __Pyx_PyObject_CallOneArg(method, obj);
31459 : Py_DECREF(method);
31460 : return result;
31461 : }
31462 : if (unlikely(!method)) goto bad;
31463 : result = __Pyx_PyObject_CallNoArg(method);
31464 : Py_DECREF(method);
31465 : bad:
31466 : return result;
31467 : }
31468 :
31469 : /* ValidateBasesTuple */
31470 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
31471 0 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
31472 0 : Py_ssize_t i, n;
31473 : #if CYTHON_ASSUME_SAFE_MACROS
31474 0 : n = PyTuple_GET_SIZE(bases);
31475 : #else
31476 : n = PyTuple_Size(bases);
31477 : if (n < 0) return -1;
31478 : #endif
31479 0 : for (i = 1; i < n; i++)
31480 : {
31481 : #if CYTHON_AVOID_BORROWED_REFS
31482 : PyObject *b0 = PySequence_GetItem(bases, i);
31483 : if (!b0) return -1;
31484 : #elif CYTHON_ASSUME_SAFE_MACROS
31485 0 : PyObject *b0 = PyTuple_GET_ITEM(bases, i);
31486 : #else
31487 : PyObject *b0 = PyTuple_GetItem(bases, i);
31488 : if (!b0) return -1;
31489 : #endif
31490 0 : PyTypeObject *b;
31491 : #if PY_MAJOR_VERSION < 3
31492 : if (PyClass_Check(b0))
31493 : {
31494 : PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
31495 : PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
31496 : #if CYTHON_AVOID_BORROWED_REFS
31497 : Py_DECREF(b0);
31498 : #endif
31499 : return -1;
31500 : }
31501 : #endif
31502 0 : b = (PyTypeObject*) b0;
31503 0 : if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
31504 : {
31505 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31506 0 : PyErr_Format(PyExc_TypeError,
31507 : "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
31508 0 : __Pyx_DECREF_TypeName(b_name);
31509 : #if CYTHON_AVOID_BORROWED_REFS
31510 : Py_DECREF(b0);
31511 : #endif
31512 0 : return -1;
31513 : }
31514 0 : if (dictoffset == 0)
31515 : {
31516 0 : Py_ssize_t b_dictoffset = 0;
31517 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
31518 0 : b_dictoffset = b->tp_dictoffset;
31519 : #else
31520 : PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
31521 : if (!py_b_dictoffset) goto dictoffset_return;
31522 : b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
31523 : Py_DECREF(py_b_dictoffset);
31524 : if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
31525 : #endif
31526 0 : if (b_dictoffset) {
31527 : {
31528 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
31529 0 : PyErr_Format(PyExc_TypeError,
31530 : "extension type '%.200s' has no __dict__ slot, "
31531 : "but base type '" __Pyx_FMT_TYPENAME "' has: "
31532 : "either add 'cdef dict __dict__' to the extension type "
31533 : "or add '__slots__ = [...]' to the base type",
31534 : type_name, b_name);
31535 0 : __Pyx_DECREF_TypeName(b_name);
31536 : }
31537 : #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
31538 : dictoffset_return:
31539 : #endif
31540 : #if CYTHON_AVOID_BORROWED_REFS
31541 : Py_DECREF(b0);
31542 : #endif
31543 0 : return -1;
31544 : }
31545 : }
31546 : #if CYTHON_AVOID_BORROWED_REFS
31547 : Py_DECREF(b0);
31548 : #endif
31549 : }
31550 : return 0;
31551 : }
31552 : #endif
31553 :
31554 : /* PyType_Ready */
31555 12 : static int __Pyx_PyType_Ready(PyTypeObject *t) {
31556 : #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
31557 : (void)__Pyx_PyObject_CallMethod0;
31558 : #if CYTHON_USE_TYPE_SPECS
31559 : (void)__Pyx_validate_bases_tuple;
31560 : #endif
31561 : return PyType_Ready(t);
31562 : #else
31563 12 : int r;
31564 12 : PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
31565 12 : if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
31566 : return -1;
31567 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31568 : {
31569 12 : int gc_was_enabled;
31570 : #if PY_VERSION_HEX >= 0x030A00b1
31571 12 : gc_was_enabled = PyGC_Disable();
31572 12 : (void)__Pyx_PyObject_CallMethod0;
31573 : #else
31574 : PyObject *ret, *py_status;
31575 : PyObject *gc = NULL;
31576 : #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
31577 : gc = PyImport_GetModule(__pyx_kp_u_gc);
31578 : #endif
31579 : if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
31580 : if (unlikely(!gc)) return -1;
31581 : py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
31582 : if (unlikely(!py_status)) {
31583 : Py_DECREF(gc);
31584 : return -1;
31585 : }
31586 : gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
31587 : Py_DECREF(py_status);
31588 : if (gc_was_enabled > 0) {
31589 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
31590 : if (unlikely(!ret)) {
31591 : Py_DECREF(gc);
31592 : return -1;
31593 : }
31594 : Py_DECREF(ret);
31595 : } else if (unlikely(gc_was_enabled == -1)) {
31596 : Py_DECREF(gc);
31597 : return -1;
31598 : }
31599 : #endif
31600 12 : t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
31601 : #if PY_VERSION_HEX >= 0x030A0000
31602 12 : t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
31603 : #endif
31604 : #else
31605 : (void)__Pyx_PyObject_CallMethod0;
31606 : #endif
31607 12 : r = PyType_Ready(t);
31608 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
31609 12 : t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
31610 : #if PY_VERSION_HEX >= 0x030A00b1
31611 12 : if (gc_was_enabled)
31612 12 : PyGC_Enable();
31613 : #else
31614 : if (gc_was_enabled) {
31615 : PyObject *tp, *v, *tb;
31616 : PyErr_Fetch(&tp, &v, &tb);
31617 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
31618 : if (likely(ret || r == -1)) {
31619 : Py_XDECREF(ret);
31620 : PyErr_Restore(tp, v, tb);
31621 : } else {
31622 : Py_XDECREF(tp);
31623 : Py_XDECREF(v);
31624 : Py_XDECREF(tb);
31625 : r = -1;
31626 : }
31627 : }
31628 : Py_DECREF(gc);
31629 : #endif
31630 : }
31631 : #endif
31632 : return r;
31633 : #endif
31634 : }
31635 :
31636 : /* SetVTable */
31637 9 : static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
31638 9 : PyObject *ob = PyCapsule_New(vtable, 0, 0);
31639 9 : if (unlikely(!ob))
31640 0 : goto bad;
31641 : #if CYTHON_COMPILING_IN_LIMITED_API
31642 : if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
31643 : #else
31644 9 : if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
31645 : #endif
31646 0 : goto bad;
31647 9 : Py_DECREF(ob);
31648 : return 0;
31649 0 : bad:
31650 0 : Py_XDECREF(ob);
31651 0 : return -1;
31652 : }
31653 :
31654 : /* GetVTable */
31655 0 : static void* __Pyx_GetVtable(PyTypeObject *type) {
31656 0 : void* ptr;
31657 : #if CYTHON_COMPILING_IN_LIMITED_API
31658 : PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
31659 : #else
31660 0 : PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
31661 : #endif
31662 0 : if (!ob)
31663 0 : goto bad;
31664 0 : ptr = PyCapsule_GetPointer(ob, 0);
31665 0 : if (!ptr && !PyErr_Occurred())
31666 0 : PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
31667 0 : Py_DECREF(ob);
31668 : return ptr;
31669 0 : bad:
31670 0 : Py_XDECREF(ob);
31671 0 : return NULL;
31672 : }
31673 :
31674 : /* MergeVTables */
31675 : #if !CYTHON_COMPILING_IN_LIMITED_API
31676 9 : static int __Pyx_MergeVtables(PyTypeObject *type) {
31677 9 : int i;
31678 9 : void** base_vtables;
31679 9 : __Pyx_TypeName tp_base_name;
31680 9 : __Pyx_TypeName base_name;
31681 9 : void* unknown = (void*)-1;
31682 9 : PyObject* bases = type->tp_bases;
31683 9 : int base_depth = 0;
31684 : {
31685 9 : PyTypeObject* base = type->tp_base;
31686 21 : while (base) {
31687 12 : base_depth += 1;
31688 12 : base = base->tp_base;
31689 : }
31690 : }
31691 9 : base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
31692 9 : base_vtables[0] = unknown;
31693 9 : for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
31694 0 : void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
31695 0 : if (base_vtable != NULL) {
31696 0 : int j;
31697 0 : PyTypeObject* base = type->tp_base;
31698 0 : for (j = 0; j < base_depth; j++) {
31699 0 : if (base_vtables[j] == unknown) {
31700 0 : base_vtables[j] = __Pyx_GetVtable(base);
31701 0 : base_vtables[j + 1] = unknown;
31702 : }
31703 0 : if (base_vtables[j] == base_vtable) {
31704 : break;
31705 0 : } else if (base_vtables[j] == NULL) {
31706 0 : goto bad;
31707 : }
31708 0 : base = base->tp_base;
31709 : }
31710 : }
31711 : }
31712 9 : PyErr_Clear();
31713 9 : free(base_vtables);
31714 9 : return 0;
31715 0 : bad:
31716 0 : tp_base_name = __Pyx_PyType_GetName(type->tp_base);
31717 0 : base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
31718 0 : PyErr_Format(PyExc_TypeError,
31719 : "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
31720 0 : __Pyx_DECREF_TypeName(tp_base_name);
31721 0 : __Pyx_DECREF_TypeName(base_name);
31722 0 : free(base_vtables);
31723 0 : return -1;
31724 : }
31725 : #endif
31726 :
31727 : /* SetupReduce */
31728 : #if !CYTHON_COMPILING_IN_LIMITED_API
31729 6 : static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
31730 6 : int ret;
31731 6 : PyObject *name_attr;
31732 6 : name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
31733 6 : if (likely(name_attr)) {
31734 6 : ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
31735 : } else {
31736 : ret = -1;
31737 : }
31738 6 : if (unlikely(ret < 0)) {
31739 0 : PyErr_Clear();
31740 0 : ret = 0;
31741 : }
31742 6 : Py_XDECREF(name_attr);
31743 6 : return ret;
31744 : }
31745 12 : static int __Pyx_setup_reduce(PyObject* type_obj) {
31746 12 : int ret = 0;
31747 12 : PyObject *object_reduce = NULL;
31748 12 : PyObject *object_getstate = NULL;
31749 12 : PyObject *object_reduce_ex = NULL;
31750 12 : PyObject *reduce = NULL;
31751 12 : PyObject *reduce_ex = NULL;
31752 12 : PyObject *reduce_cython = NULL;
31753 12 : PyObject *setstate = NULL;
31754 12 : PyObject *setstate_cython = NULL;
31755 12 : PyObject *getstate = NULL;
31756 : #if CYTHON_USE_PYTYPE_LOOKUP
31757 12 : getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
31758 : #else
31759 : getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
31760 : if (!getstate && PyErr_Occurred()) {
31761 : goto __PYX_BAD;
31762 : }
31763 : #endif
31764 12 : if (getstate) {
31765 : #if CYTHON_USE_PYTYPE_LOOKUP
31766 12 : object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
31767 : #else
31768 : object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
31769 : if (!object_getstate && PyErr_Occurred()) {
31770 : goto __PYX_BAD;
31771 : }
31772 : #endif
31773 12 : if (object_getstate != getstate) {
31774 0 : goto __PYX_GOOD;
31775 : }
31776 : }
31777 : #if CYTHON_USE_PYTYPE_LOOKUP
31778 12 : object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31779 : #else
31780 : object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
31781 : #endif
31782 12 : reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
31783 12 : if (reduce_ex == object_reduce_ex) {
31784 : #if CYTHON_USE_PYTYPE_LOOKUP
31785 12 : object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31786 : #else
31787 : object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
31788 : #endif
31789 12 : reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
31790 12 : if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
31791 12 : reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
31792 12 : if (likely(reduce_cython)) {
31793 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31794 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31795 0 : } else if (reduce == object_reduce || PyErr_Occurred()) {
31796 0 : goto __PYX_BAD;
31797 : }
31798 12 : setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
31799 12 : if (!setstate) PyErr_Clear();
31800 12 : if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
31801 12 : setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
31802 12 : if (likely(setstate_cython)) {
31803 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31804 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
31805 0 : } else if (!setstate || PyErr_Occurred()) {
31806 0 : goto __PYX_BAD;
31807 : }
31808 : }
31809 12 : PyType_Modified((PyTypeObject*)type_obj);
31810 : }
31811 : }
31812 12 : goto __PYX_GOOD;
31813 0 : __PYX_BAD:
31814 0 : if (!PyErr_Occurred()) {
31815 0 : __Pyx_TypeName type_obj_name =
31816 : __Pyx_PyType_GetName((PyTypeObject*)type_obj);
31817 0 : PyErr_Format(PyExc_RuntimeError,
31818 : "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
31819 : __Pyx_DECREF_TypeName(type_obj_name);
31820 : }
31821 : ret = -1;
31822 12 : __PYX_GOOD:
31823 : #if !CYTHON_USE_PYTYPE_LOOKUP
31824 : Py_XDECREF(object_reduce);
31825 : Py_XDECREF(object_reduce_ex);
31826 : Py_XDECREF(object_getstate);
31827 : Py_XDECREF(getstate);
31828 : #endif
31829 12 : Py_XDECREF(reduce);
31830 12 : Py_XDECREF(reduce_ex);
31831 12 : Py_XDECREF(reduce_cython);
31832 12 : Py_XDECREF(setstate);
31833 12 : Py_XDECREF(setstate_cython);
31834 12 : return ret;
31835 : }
31836 : #endif
31837 :
31838 : /* TypeImport */
31839 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
31840 : #define __PYX_HAVE_RT_ImportType_3_0_11
31841 48 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
31842 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
31843 : {
31844 48 : PyObject *result = 0;
31845 48 : char warning[200];
31846 48 : Py_ssize_t basicsize;
31847 48 : Py_ssize_t itemsize;
31848 : #if CYTHON_COMPILING_IN_LIMITED_API
31849 : PyObject *py_basicsize;
31850 : PyObject *py_itemsize;
31851 : #endif
31852 48 : result = PyObject_GetAttrString(module, class_name);
31853 48 : if (!result)
31854 0 : goto bad;
31855 48 : if (!PyType_Check(result)) {
31856 0 : PyErr_Format(PyExc_TypeError,
31857 : "%.200s.%.200s is not a type object",
31858 : module_name, class_name);
31859 0 : goto bad;
31860 : }
31861 : #if !CYTHON_COMPILING_IN_LIMITED_API
31862 48 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
31863 48 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
31864 : #else
31865 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
31866 : if (!py_basicsize)
31867 : goto bad;
31868 : basicsize = PyLong_AsSsize_t(py_basicsize);
31869 : Py_DECREF(py_basicsize);
31870 : py_basicsize = 0;
31871 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
31872 : goto bad;
31873 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
31874 : if (!py_itemsize)
31875 : goto bad;
31876 : itemsize = PyLong_AsSsize_t(py_itemsize);
31877 : Py_DECREF(py_itemsize);
31878 : py_itemsize = 0;
31879 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
31880 : goto bad;
31881 : #endif
31882 48 : if (itemsize) {
31883 3 : if (size % alignment) {
31884 0 : alignment = size % alignment;
31885 : }
31886 3 : if (itemsize < (Py_ssize_t)alignment)
31887 : itemsize = (Py_ssize_t)alignment;
31888 : }
31889 48 : if ((size_t)(basicsize + itemsize) < size) {
31890 0 : PyErr_Format(PyExc_ValueError,
31891 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
31892 : "Expected %zd from C header, got %zd from PyObject",
31893 : module_name, class_name, size, basicsize+itemsize);
31894 0 : goto bad;
31895 : }
31896 48 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
31897 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
31898 0 : PyErr_Format(PyExc_ValueError,
31899 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
31900 : "Expected %zd from C header, got %zd-%zd from PyObject",
31901 : module_name, class_name, size, basicsize, basicsize+itemsize);
31902 0 : goto bad;
31903 : }
31904 48 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
31905 0 : PyOS_snprintf(warning, sizeof(warning),
31906 : "%s.%s size changed, may indicate binary incompatibility. "
31907 : "Expected %zd from C header, got %zd from PyObject",
31908 : module_name, class_name, size, basicsize);
31909 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
31910 : }
31911 : return (PyTypeObject *)result;
31912 0 : bad:
31913 0 : Py_XDECREF(result);
31914 0 : return NULL;
31915 : }
31916 : #endif
31917 :
31918 : /* FetchSharedCythonModule */
31919 3 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
31920 3 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
31921 : }
31922 :
31923 : /* FetchCommonType */
31924 3 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
31925 : const char *name,
31926 : Py_ssize_t basicsize,
31927 : Py_ssize_t expected_basicsize) {
31928 3 : if (!PyType_Check(cached_type)) {
31929 0 : PyErr_Format(PyExc_TypeError,
31930 : "Shared Cython type %.200s is not a type object", name);
31931 0 : return -1;
31932 : }
31933 3 : if (basicsize != expected_basicsize) {
31934 0 : PyErr_Format(PyExc_TypeError,
31935 : "Shared Cython type %.200s has the wrong size, try recompiling",
31936 : name);
31937 0 : return -1;
31938 : }
31939 : return 0;
31940 : }
31941 : #if !CYTHON_USE_TYPE_SPECS
31942 3 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
31943 3 : PyObject* abi_module;
31944 3 : const char* object_name;
31945 3 : PyTypeObject *cached_type = NULL;
31946 3 : abi_module = __Pyx_FetchSharedCythonABIModule();
31947 3 : if (!abi_module) return NULL;
31948 3 : object_name = strrchr(type->tp_name, '.');
31949 3 : object_name = object_name ? object_name+1 : type->tp_name;
31950 3 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
31951 3 : if (cached_type) {
31952 3 : if (__Pyx_VerifyCachedType(
31953 : (PyObject *)cached_type,
31954 : object_name,
31955 : cached_type->tp_basicsize,
31956 : type->tp_basicsize) < 0) {
31957 0 : goto bad;
31958 : }
31959 3 : goto done;
31960 : }
31961 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
31962 0 : PyErr_Clear();
31963 0 : if (PyType_Ready(type) < 0) goto bad;
31964 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
31965 0 : goto bad;
31966 0 : Py_INCREF(type);
31967 : cached_type = type;
31968 3 : done:
31969 3 : Py_DECREF(abi_module);
31970 : return cached_type;
31971 0 : bad:
31972 0 : Py_XDECREF(cached_type);
31973 0 : cached_type = NULL;
31974 0 : goto done;
31975 : }
31976 : #else
31977 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
31978 : PyObject *abi_module, *cached_type = NULL;
31979 : const char* object_name = strrchr(spec->name, '.');
31980 : object_name = object_name ? object_name+1 : spec->name;
31981 : abi_module = __Pyx_FetchSharedCythonABIModule();
31982 : if (!abi_module) return NULL;
31983 : cached_type = PyObject_GetAttrString(abi_module, object_name);
31984 : if (cached_type) {
31985 : Py_ssize_t basicsize;
31986 : #if CYTHON_COMPILING_IN_LIMITED_API
31987 : PyObject *py_basicsize;
31988 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
31989 : if (unlikely(!py_basicsize)) goto bad;
31990 : basicsize = PyLong_AsSsize_t(py_basicsize);
31991 : Py_DECREF(py_basicsize);
31992 : py_basicsize = 0;
31993 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
31994 : #else
31995 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
31996 : #endif
31997 : if (__Pyx_VerifyCachedType(
31998 : cached_type,
31999 : object_name,
32000 : basicsize,
32001 : spec->basicsize) < 0) {
32002 : goto bad;
32003 : }
32004 : goto done;
32005 : }
32006 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
32007 : PyErr_Clear();
32008 : CYTHON_UNUSED_VAR(module);
32009 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
32010 : if (unlikely(!cached_type)) goto bad;
32011 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
32012 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
32013 : done:
32014 : Py_DECREF(abi_module);
32015 : assert(cached_type == NULL || PyType_Check(cached_type));
32016 : return (PyTypeObject *) cached_type;
32017 : bad:
32018 : Py_XDECREF(cached_type);
32019 : cached_type = NULL;
32020 : goto done;
32021 : }
32022 : #endif
32023 :
32024 : /* PyVectorcallFastCallDict */
32025 : #if CYTHON_METH_FASTCALL
32026 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
32027 : {
32028 0 : PyObject *res = NULL;
32029 0 : PyObject *kwnames;
32030 0 : PyObject **newargs;
32031 0 : PyObject **kwvalues;
32032 0 : Py_ssize_t i, pos;
32033 0 : size_t j;
32034 0 : PyObject *key, *value;
32035 0 : unsigned long keys_are_strings;
32036 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
32037 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
32038 0 : if (unlikely(newargs == NULL)) {
32039 0 : PyErr_NoMemory();
32040 0 : return NULL;
32041 : }
32042 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
32043 0 : kwnames = PyTuple_New(nkw);
32044 0 : if (unlikely(kwnames == NULL)) {
32045 0 : PyMem_Free(newargs);
32046 0 : return NULL;
32047 : }
32048 0 : kwvalues = newargs + nargs;
32049 0 : pos = i = 0;
32050 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
32051 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
32052 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
32053 0 : Py_INCREF(key);
32054 0 : Py_INCREF(value);
32055 0 : PyTuple_SET_ITEM(kwnames, i, key);
32056 0 : kwvalues[i] = value;
32057 0 : i++;
32058 : }
32059 0 : if (unlikely(!keys_are_strings)) {
32060 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
32061 0 : goto cleanup;
32062 : }
32063 0 : res = vc(func, newargs, nargs, kwnames);
32064 0 : cleanup:
32065 0 : Py_DECREF(kwnames);
32066 0 : for (i = 0; i < nkw; i++)
32067 0 : Py_DECREF(kwvalues[i]);
32068 0 : PyMem_Free(newargs);
32069 0 : return res;
32070 : }
32071 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
32072 : {
32073 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
32074 0 : return vc(func, args, nargs, NULL);
32075 : }
32076 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
32077 : }
32078 : #endif
32079 :
32080 : /* CythonFunctionShared */
32081 : #if CYTHON_COMPILING_IN_LIMITED_API
32082 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
32083 : if (__Pyx_CyFunction_Check(func)) {
32084 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
32085 : } else if (PyCFunction_Check(func)) {
32086 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
32087 : }
32088 : return 0;
32089 : }
32090 : #else
32091 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
32092 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
32093 : }
32094 : #endif
32095 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
32096 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
32097 : __Pyx_Py_XDECREF_SET(
32098 : __Pyx_CyFunction_GetClassObj(f),
32099 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
32100 : #else
32101 : __Pyx_Py_XDECREF_SET(
32102 : ((PyCMethodObject *) (f))->mm_class,
32103 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
32104 : #endif
32105 : }
32106 : static PyObject *
32107 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
32108 : {
32109 0 : CYTHON_UNUSED_VAR(closure);
32110 0 : if (unlikely(op->func_doc == NULL)) {
32111 : #if CYTHON_COMPILING_IN_LIMITED_API
32112 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
32113 : if (unlikely(!op->func_doc)) return NULL;
32114 : #else
32115 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
32116 : #if PY_MAJOR_VERSION >= 3
32117 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
32118 : #else
32119 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
32120 : #endif
32121 0 : if (unlikely(op->func_doc == NULL))
32122 : return NULL;
32123 : } else {
32124 0 : Py_INCREF(Py_None);
32125 0 : return Py_None;
32126 : }
32127 : #endif
32128 : }
32129 0 : Py_INCREF(op->func_doc);
32130 : return op->func_doc;
32131 : }
32132 : static int
32133 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32134 : {
32135 0 : CYTHON_UNUSED_VAR(context);
32136 0 : if (value == NULL) {
32137 0 : value = Py_None;
32138 : }
32139 0 : Py_INCREF(value);
32140 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
32141 0 : return 0;
32142 : }
32143 : static PyObject *
32144 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
32145 : {
32146 0 : CYTHON_UNUSED_VAR(context);
32147 0 : if (unlikely(op->func_name == NULL)) {
32148 : #if CYTHON_COMPILING_IN_LIMITED_API
32149 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
32150 : #elif PY_MAJOR_VERSION >= 3
32151 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
32152 : #else
32153 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
32154 : #endif
32155 0 : if (unlikely(op->func_name == NULL))
32156 : return NULL;
32157 : }
32158 0 : Py_INCREF(op->func_name);
32159 : return op->func_name;
32160 : }
32161 : static int
32162 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32163 : {
32164 0 : CYTHON_UNUSED_VAR(context);
32165 : #if PY_MAJOR_VERSION >= 3
32166 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
32167 : #else
32168 : if (unlikely(value == NULL || !PyString_Check(value)))
32169 : #endif
32170 : {
32171 0 : PyErr_SetString(PyExc_TypeError,
32172 : "__name__ must be set to a string object");
32173 0 : return -1;
32174 : }
32175 0 : Py_INCREF(value);
32176 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
32177 0 : return 0;
32178 : }
32179 : static PyObject *
32180 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
32181 : {
32182 0 : CYTHON_UNUSED_VAR(context);
32183 0 : Py_INCREF(op->func_qualname);
32184 0 : return op->func_qualname;
32185 : }
32186 : static int
32187 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32188 : {
32189 0 : CYTHON_UNUSED_VAR(context);
32190 : #if PY_MAJOR_VERSION >= 3
32191 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
32192 : #else
32193 : if (unlikely(value == NULL || !PyString_Check(value)))
32194 : #endif
32195 : {
32196 0 : PyErr_SetString(PyExc_TypeError,
32197 : "__qualname__ must be set to a string object");
32198 0 : return -1;
32199 : }
32200 0 : Py_INCREF(value);
32201 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
32202 0 : return 0;
32203 : }
32204 : static PyObject *
32205 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
32206 : {
32207 0 : CYTHON_UNUSED_VAR(context);
32208 0 : if (unlikely(op->func_dict == NULL)) {
32209 0 : op->func_dict = PyDict_New();
32210 0 : if (unlikely(op->func_dict == NULL))
32211 : return NULL;
32212 : }
32213 0 : Py_INCREF(op->func_dict);
32214 : return op->func_dict;
32215 : }
32216 : static int
32217 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
32218 : {
32219 0 : CYTHON_UNUSED_VAR(context);
32220 0 : if (unlikely(value == NULL)) {
32221 0 : PyErr_SetString(PyExc_TypeError,
32222 : "function's dictionary may not be deleted");
32223 0 : return -1;
32224 : }
32225 0 : if (unlikely(!PyDict_Check(value))) {
32226 0 : PyErr_SetString(PyExc_TypeError,
32227 : "setting function's dictionary to a non-dict");
32228 0 : return -1;
32229 : }
32230 0 : Py_INCREF(value);
32231 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
32232 0 : return 0;
32233 : }
32234 : static PyObject *
32235 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
32236 : {
32237 0 : CYTHON_UNUSED_VAR(context);
32238 0 : Py_INCREF(op->func_globals);
32239 0 : return op->func_globals;
32240 : }
32241 : static PyObject *
32242 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
32243 : {
32244 0 : CYTHON_UNUSED_VAR(op);
32245 0 : CYTHON_UNUSED_VAR(context);
32246 0 : Py_INCREF(Py_None);
32247 0 : return Py_None;
32248 : }
32249 : static PyObject *
32250 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
32251 : {
32252 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
32253 0 : CYTHON_UNUSED_VAR(context);
32254 0 : Py_INCREF(result);
32255 0 : return result;
32256 : }
32257 : static int
32258 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
32259 0 : int result = 0;
32260 0 : PyObject *res = op->defaults_getter((PyObject *) op);
32261 0 : if (unlikely(!res))
32262 : return -1;
32263 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32264 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
32265 0 : Py_INCREF(op->defaults_tuple);
32266 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
32267 0 : Py_INCREF(op->defaults_kwdict);
32268 : #else
32269 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
32270 : if (unlikely(!op->defaults_tuple)) result = -1;
32271 : else {
32272 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
32273 : if (unlikely(!op->defaults_kwdict)) result = -1;
32274 : }
32275 : #endif
32276 0 : Py_DECREF(res);
32277 : return result;
32278 : }
32279 : static int
32280 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32281 0 : CYTHON_UNUSED_VAR(context);
32282 0 : if (!value) {
32283 : value = Py_None;
32284 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
32285 0 : PyErr_SetString(PyExc_TypeError,
32286 : "__defaults__ must be set to a tuple object");
32287 0 : return -1;
32288 : }
32289 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
32290 : "currently affect the values used in function calls", 1);
32291 0 : Py_INCREF(value);
32292 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
32293 0 : return 0;
32294 : }
32295 : static PyObject *
32296 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
32297 0 : PyObject* result = op->defaults_tuple;
32298 0 : CYTHON_UNUSED_VAR(context);
32299 0 : if (unlikely(!result)) {
32300 0 : if (op->defaults_getter) {
32301 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
32302 0 : result = op->defaults_tuple;
32303 : } else {
32304 : result = Py_None;
32305 : }
32306 : }
32307 0 : Py_INCREF(result);
32308 : return result;
32309 : }
32310 : static int
32311 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32312 0 : CYTHON_UNUSED_VAR(context);
32313 0 : if (!value) {
32314 : value = Py_None;
32315 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
32316 0 : PyErr_SetString(PyExc_TypeError,
32317 : "__kwdefaults__ must be set to a dict object");
32318 0 : return -1;
32319 : }
32320 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
32321 : "currently affect the values used in function calls", 1);
32322 0 : Py_INCREF(value);
32323 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
32324 0 : return 0;
32325 : }
32326 : static PyObject *
32327 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
32328 0 : PyObject* result = op->defaults_kwdict;
32329 0 : CYTHON_UNUSED_VAR(context);
32330 0 : if (unlikely(!result)) {
32331 0 : if (op->defaults_getter) {
32332 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
32333 0 : result = op->defaults_kwdict;
32334 : } else {
32335 : result = Py_None;
32336 : }
32337 : }
32338 0 : Py_INCREF(result);
32339 : return result;
32340 : }
32341 : static int
32342 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32343 0 : CYTHON_UNUSED_VAR(context);
32344 0 : if (!value || value == Py_None) {
32345 : value = NULL;
32346 0 : } else if (unlikely(!PyDict_Check(value))) {
32347 0 : PyErr_SetString(PyExc_TypeError,
32348 : "__annotations__ must be set to a dict object");
32349 0 : return -1;
32350 : }
32351 0 : Py_XINCREF(value);
32352 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
32353 0 : return 0;
32354 : }
32355 : static PyObject *
32356 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
32357 0 : PyObject* result = op->func_annotations;
32358 0 : CYTHON_UNUSED_VAR(context);
32359 0 : if (unlikely(!result)) {
32360 0 : result = PyDict_New();
32361 0 : if (unlikely(!result)) return NULL;
32362 0 : op->func_annotations = result;
32363 : }
32364 0 : Py_INCREF(result);
32365 : return result;
32366 : }
32367 : static PyObject *
32368 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
32369 0 : int is_coroutine;
32370 0 : CYTHON_UNUSED_VAR(context);
32371 0 : if (op->func_is_coroutine) {
32372 0 : return __Pyx_NewRef(op->func_is_coroutine);
32373 : }
32374 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
32375 : #if PY_VERSION_HEX >= 0x03050000
32376 0 : if (is_coroutine) {
32377 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
32378 0 : fromlist = PyList_New(1);
32379 0 : if (unlikely(!fromlist)) return NULL;
32380 0 : Py_INCREF(marker);
32381 : #if CYTHON_ASSUME_SAFE_MACROS
32382 0 : PyList_SET_ITEM(fromlist, 0, marker);
32383 : #else
32384 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
32385 : Py_DECREF(marker);
32386 : Py_DECREF(fromlist);
32387 : return NULL;
32388 : }
32389 : #endif
32390 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
32391 0 : Py_DECREF(fromlist);
32392 0 : if (unlikely(!module)) goto ignore;
32393 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
32394 0 : Py_DECREF(module);
32395 0 : if (likely(op->func_is_coroutine)) {
32396 0 : return __Pyx_NewRef(op->func_is_coroutine);
32397 : }
32398 0 : ignore:
32399 0 : PyErr_Clear();
32400 : }
32401 : #endif
32402 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
32403 0 : return __Pyx_NewRef(op->func_is_coroutine);
32404 : }
32405 : #if CYTHON_COMPILING_IN_LIMITED_API
32406 : static PyObject *
32407 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
32408 : CYTHON_UNUSED_VAR(context);
32409 : return PyObject_GetAttrString(op->func, "__module__");
32410 : }
32411 : static int
32412 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
32413 : CYTHON_UNUSED_VAR(context);
32414 : return PyObject_SetAttrString(op->func, "__module__", value);
32415 : }
32416 : #endif
32417 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
32418 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32419 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
32420 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32421 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
32422 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
32423 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
32424 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
32425 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32426 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
32427 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32428 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
32429 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32430 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
32431 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32432 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
32433 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
32434 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
32435 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
32436 : #if CYTHON_COMPILING_IN_LIMITED_API
32437 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
32438 : #endif
32439 : {0, 0, 0, 0, 0}
32440 : };
32441 : static PyMemberDef __pyx_CyFunction_members[] = {
32442 : #if !CYTHON_COMPILING_IN_LIMITED_API
32443 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
32444 : #endif
32445 : #if CYTHON_USE_TYPE_SPECS
32446 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
32447 : #if CYTHON_METH_FASTCALL
32448 : #if CYTHON_BACKPORT_VECTORCALL
32449 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
32450 : #else
32451 : #if !CYTHON_COMPILING_IN_LIMITED_API
32452 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
32453 : #endif
32454 : #endif
32455 : #endif
32456 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32457 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
32458 : #else
32459 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
32460 : #endif
32461 : #endif
32462 : {0, 0, 0, 0, 0}
32463 : };
32464 : static PyObject *
32465 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
32466 : {
32467 0 : CYTHON_UNUSED_VAR(args);
32468 : #if PY_MAJOR_VERSION >= 3
32469 0 : Py_INCREF(m->func_qualname);
32470 0 : return m->func_qualname;
32471 : #else
32472 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
32473 : #endif
32474 : }
32475 : static PyMethodDef __pyx_CyFunction_methods[] = {
32476 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
32477 : {0, 0, 0, 0}
32478 : };
32479 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
32480 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
32481 : #else
32482 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
32483 : #endif
32484 18 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
32485 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
32486 : #if !CYTHON_COMPILING_IN_LIMITED_API
32487 18 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
32488 : #endif
32489 18 : if (unlikely(op == NULL))
32490 : return NULL;
32491 : #if CYTHON_COMPILING_IN_LIMITED_API
32492 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
32493 : if (unlikely(!op->func)) return NULL;
32494 : #endif
32495 18 : op->flags = flags;
32496 18 : __Pyx_CyFunction_weakreflist(op) = NULL;
32497 : #if !CYTHON_COMPILING_IN_LIMITED_API
32498 18 : cf->m_ml = ml;
32499 18 : cf->m_self = (PyObject *) op;
32500 : #endif
32501 18 : Py_XINCREF(closure);
32502 18 : op->func_closure = closure;
32503 : #if !CYTHON_COMPILING_IN_LIMITED_API
32504 18 : Py_XINCREF(module);
32505 18 : cf->m_module = module;
32506 : #endif
32507 18 : op->func_dict = NULL;
32508 18 : op->func_name = NULL;
32509 18 : Py_INCREF(qualname);
32510 18 : op->func_qualname = qualname;
32511 18 : op->func_doc = NULL;
32512 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
32513 : op->func_classobj = NULL;
32514 : #else
32515 18 : ((PyCMethodObject*)op)->mm_class = NULL;
32516 : #endif
32517 18 : op->func_globals = globals;
32518 18 : Py_INCREF(op->func_globals);
32519 18 : Py_XINCREF(code);
32520 18 : op->func_code = code;
32521 18 : op->defaults_pyobjects = 0;
32522 18 : op->defaults_size = 0;
32523 18 : op->defaults = NULL;
32524 18 : op->defaults_tuple = NULL;
32525 18 : op->defaults_kwdict = NULL;
32526 18 : op->defaults_getter = NULL;
32527 18 : op->func_annotations = NULL;
32528 18 : op->func_is_coroutine = NULL;
32529 : #if CYTHON_METH_FASTCALL
32530 18 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
32531 0 : case METH_NOARGS:
32532 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
32533 0 : break;
32534 0 : case METH_O:
32535 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
32536 0 : break;
32537 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
32538 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
32539 0 : break;
32540 18 : case METH_FASTCALL | METH_KEYWORDS:
32541 18 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
32542 18 : break;
32543 0 : case METH_VARARGS | METH_KEYWORDS:
32544 0 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
32545 0 : break;
32546 0 : default:
32547 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32548 0 : Py_DECREF(op);
32549 : return NULL;
32550 : }
32551 : #endif
32552 : return (PyObject *) op;
32553 : }
32554 : static int
32555 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
32556 : {
32557 0 : Py_CLEAR(m->func_closure);
32558 : #if CYTHON_COMPILING_IN_LIMITED_API
32559 : Py_CLEAR(m->func);
32560 : #else
32561 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
32562 : #endif
32563 0 : Py_CLEAR(m->func_dict);
32564 0 : Py_CLEAR(m->func_name);
32565 0 : Py_CLEAR(m->func_qualname);
32566 0 : Py_CLEAR(m->func_doc);
32567 0 : Py_CLEAR(m->func_globals);
32568 0 : Py_CLEAR(m->func_code);
32569 : #if !CYTHON_COMPILING_IN_LIMITED_API
32570 : #if PY_VERSION_HEX < 0x030900B1
32571 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
32572 : #else
32573 : {
32574 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
32575 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
32576 0 : Py_XDECREF(cls);
32577 : }
32578 : #endif
32579 : #endif
32580 0 : Py_CLEAR(m->defaults_tuple);
32581 0 : Py_CLEAR(m->defaults_kwdict);
32582 0 : Py_CLEAR(m->func_annotations);
32583 0 : Py_CLEAR(m->func_is_coroutine);
32584 0 : if (m->defaults) {
32585 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32586 : int i;
32587 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32588 0 : Py_XDECREF(pydefaults[i]);
32589 0 : PyObject_Free(m->defaults);
32590 0 : m->defaults = NULL;
32591 : }
32592 0 : return 0;
32593 : }
32594 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
32595 : {
32596 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
32597 0 : PyObject_ClearWeakRefs((PyObject *) m);
32598 0 : __Pyx_CyFunction_clear(m);
32599 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
32600 0 : }
32601 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
32602 : {
32603 0 : PyObject_GC_UnTrack(m);
32604 0 : __Pyx__CyFunction_dealloc(m);
32605 0 : }
32606 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
32607 : {
32608 0 : Py_VISIT(m->func_closure);
32609 : #if CYTHON_COMPILING_IN_LIMITED_API
32610 : Py_VISIT(m->func);
32611 : #else
32612 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
32613 : #endif
32614 0 : Py_VISIT(m->func_dict);
32615 0 : Py_VISIT(m->func_name);
32616 0 : Py_VISIT(m->func_qualname);
32617 0 : Py_VISIT(m->func_doc);
32618 0 : Py_VISIT(m->func_globals);
32619 0 : Py_VISIT(m->func_code);
32620 : #if !CYTHON_COMPILING_IN_LIMITED_API
32621 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
32622 : #endif
32623 0 : Py_VISIT(m->defaults_tuple);
32624 0 : Py_VISIT(m->defaults_kwdict);
32625 0 : Py_VISIT(m->func_is_coroutine);
32626 0 : if (m->defaults) {
32627 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
32628 : int i;
32629 0 : for (i = 0; i < m->defaults_pyobjects; i++)
32630 0 : Py_VISIT(pydefaults[i]);
32631 : }
32632 : return 0;
32633 : }
32634 : static PyObject*
32635 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
32636 : {
32637 : #if PY_MAJOR_VERSION >= 3
32638 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
32639 : op->func_qualname, (void *)op);
32640 : #else
32641 : return PyString_FromFormat("<cyfunction %s at %p>",
32642 : PyString_AsString(op->func_qualname), (void *)op);
32643 : #endif
32644 : }
32645 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
32646 : #if CYTHON_COMPILING_IN_LIMITED_API
32647 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
32648 : PyObject *py_name = NULL;
32649 : PyCFunction meth;
32650 : int flags;
32651 : meth = PyCFunction_GetFunction(f);
32652 : if (unlikely(!meth)) return NULL;
32653 : flags = PyCFunction_GetFlags(f);
32654 : if (unlikely(flags < 0)) return NULL;
32655 : #else
32656 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
32657 0 : PyCFunction meth = f->m_ml->ml_meth;
32658 0 : int flags = f->m_ml->ml_flags;
32659 : #endif
32660 0 : Py_ssize_t size;
32661 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
32662 0 : case METH_VARARGS:
32663 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
32664 0 : return (*meth)(self, arg);
32665 : break;
32666 0 : case METH_VARARGS | METH_KEYWORDS:
32667 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
32668 0 : case METH_NOARGS:
32669 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32670 : #if CYTHON_ASSUME_SAFE_MACROS
32671 0 : size = PyTuple_GET_SIZE(arg);
32672 : #else
32673 : size = PyTuple_Size(arg);
32674 : if (unlikely(size < 0)) return NULL;
32675 : #endif
32676 0 : if (likely(size == 0))
32677 0 : return (*meth)(self, NULL);
32678 : #if CYTHON_COMPILING_IN_LIMITED_API
32679 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32680 : if (!py_name) return NULL;
32681 : PyErr_Format(PyExc_TypeError,
32682 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32683 : py_name, size);
32684 : Py_DECREF(py_name);
32685 : #else
32686 0 : PyErr_Format(PyExc_TypeError,
32687 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32688 0 : f->m_ml->ml_name, size);
32689 : #endif
32690 0 : return NULL;
32691 : }
32692 : break;
32693 0 : case METH_O:
32694 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
32695 : #if CYTHON_ASSUME_SAFE_MACROS
32696 0 : size = PyTuple_GET_SIZE(arg);
32697 : #else
32698 : size = PyTuple_Size(arg);
32699 : if (unlikely(size < 0)) return NULL;
32700 : #endif
32701 0 : if (likely(size == 1)) {
32702 0 : PyObject *result, *arg0;
32703 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32704 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
32705 : #else
32706 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
32707 : #endif
32708 0 : result = (*meth)(self, arg0);
32709 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
32710 : Py_DECREF(arg0);
32711 : #endif
32712 0 : return result;
32713 : }
32714 : #if CYTHON_COMPILING_IN_LIMITED_API
32715 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32716 : if (!py_name) return NULL;
32717 : PyErr_Format(PyExc_TypeError,
32718 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32719 : py_name, size);
32720 : Py_DECREF(py_name);
32721 : #else
32722 0 : PyErr_Format(PyExc_TypeError,
32723 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32724 0 : f->m_ml->ml_name, size);
32725 : #endif
32726 0 : return NULL;
32727 : }
32728 : break;
32729 0 : default:
32730 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
32731 0 : return NULL;
32732 : }
32733 : #if CYTHON_COMPILING_IN_LIMITED_API
32734 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
32735 : if (!py_name) return NULL;
32736 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
32737 : py_name);
32738 : Py_DECREF(py_name);
32739 : #else
32740 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
32741 0 : f->m_ml->ml_name);
32742 : #endif
32743 0 : return NULL;
32744 : }
32745 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
32746 0 : PyObject *self, *result;
32747 : #if CYTHON_COMPILING_IN_LIMITED_API
32748 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
32749 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
32750 : #else
32751 0 : self = ((PyCFunctionObject*)func)->m_self;
32752 : #endif
32753 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
32754 0 : return result;
32755 : }
32756 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
32757 0 : PyObject *result;
32758 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
32759 : #if CYTHON_METH_FASTCALL
32760 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
32761 0 : if (vc) {
32762 : #if CYTHON_ASSUME_SAFE_MACROS
32763 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
32764 : #else
32765 : (void) &__Pyx_PyVectorcall_FastCallDict;
32766 : return PyVectorcall_Call(func, args, kw);
32767 : #endif
32768 : }
32769 : #endif
32770 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32771 0 : Py_ssize_t argc;
32772 0 : PyObject *new_args;
32773 0 : PyObject *self;
32774 : #if CYTHON_ASSUME_SAFE_MACROS
32775 0 : argc = PyTuple_GET_SIZE(args);
32776 : #else
32777 : argc = PyTuple_Size(args);
32778 : if (unlikely(!argc) < 0) return NULL;
32779 : #endif
32780 0 : new_args = PyTuple_GetSlice(args, 1, argc);
32781 0 : if (unlikely(!new_args))
32782 : return NULL;
32783 0 : self = PyTuple_GetItem(args, 0);
32784 0 : if (unlikely(!self)) {
32785 0 : Py_DECREF(new_args);
32786 : #if PY_MAJOR_VERSION > 2
32787 0 : PyErr_Format(PyExc_TypeError,
32788 : "unbound method %.200S() needs an argument",
32789 : cyfunc->func_qualname);
32790 : #else
32791 : PyErr_SetString(PyExc_TypeError,
32792 : "unbound method needs an argument");
32793 : #endif
32794 0 : return NULL;
32795 : }
32796 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
32797 0 : Py_DECREF(new_args);
32798 : } else {
32799 0 : result = __Pyx_CyFunction_Call(func, args, kw);
32800 : }
32801 : return result;
32802 : }
32803 : #if CYTHON_METH_FASTCALL
32804 103 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
32805 : {
32806 103 : int ret = 0;
32807 103 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
32808 0 : if (unlikely(nargs < 1)) {
32809 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
32810 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
32811 0 : return -1;
32812 : }
32813 : ret = 1;
32814 : }
32815 103 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
32816 0 : PyErr_Format(PyExc_TypeError,
32817 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
32818 0 : return -1;
32819 : }
32820 : return ret;
32821 : }
32822 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32823 : {
32824 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32825 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32826 : #if CYTHON_BACKPORT_VECTORCALL
32827 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32828 : #else
32829 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32830 : #endif
32831 0 : PyObject *self;
32832 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
32833 0 : case 1:
32834 0 : self = args[0];
32835 0 : args += 1;
32836 0 : nargs -= 1;
32837 0 : break;
32838 0 : case 0:
32839 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32840 0 : break;
32841 : default:
32842 : return NULL;
32843 : }
32844 0 : if (unlikely(nargs != 0)) {
32845 0 : PyErr_Format(PyExc_TypeError,
32846 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
32847 : def->ml_name, nargs);
32848 0 : return NULL;
32849 : }
32850 0 : return def->ml_meth(self, NULL);
32851 : }
32852 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32853 : {
32854 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32855 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32856 : #if CYTHON_BACKPORT_VECTORCALL
32857 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32858 : #else
32859 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32860 : #endif
32861 0 : PyObject *self;
32862 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
32863 0 : case 1:
32864 0 : self = args[0];
32865 0 : args += 1;
32866 0 : nargs -= 1;
32867 0 : break;
32868 0 : case 0:
32869 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32870 0 : break;
32871 : default:
32872 : return NULL;
32873 : }
32874 0 : if (unlikely(nargs != 1)) {
32875 0 : PyErr_Format(PyExc_TypeError,
32876 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
32877 : def->ml_name, nargs);
32878 0 : return NULL;
32879 : }
32880 0 : return def->ml_meth(self, args[0]);
32881 : }
32882 103 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32883 : {
32884 103 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32885 103 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32886 : #if CYTHON_BACKPORT_VECTORCALL
32887 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32888 : #else
32889 103 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32890 : #endif
32891 103 : PyObject *self;
32892 103 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
32893 0 : case 1:
32894 0 : self = args[0];
32895 0 : args += 1;
32896 0 : nargs -= 1;
32897 0 : break;
32898 103 : case 0:
32899 103 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32900 103 : break;
32901 : default:
32902 : return NULL;
32903 : }
32904 103 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
32905 : }
32906 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
32907 : {
32908 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
32909 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
32910 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
32911 : #if CYTHON_BACKPORT_VECTORCALL
32912 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
32913 : #else
32914 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
32915 : #endif
32916 0 : PyObject *self;
32917 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
32918 0 : case 1:
32919 0 : self = args[0];
32920 0 : args += 1;
32921 0 : nargs -= 1;
32922 0 : break;
32923 0 : case 0:
32924 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
32925 0 : break;
32926 : default:
32927 : return NULL;
32928 : }
32929 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
32930 : }
32931 : #endif
32932 : #if CYTHON_USE_TYPE_SPECS
32933 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
32934 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
32935 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
32936 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
32937 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
32938 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
32939 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
32940 : {Py_tp_members, (void *)__pyx_CyFunction_members},
32941 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
32942 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
32943 : {0, 0},
32944 : };
32945 : static PyType_Spec __pyx_CyFunctionType_spec = {
32946 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
32947 : sizeof(__pyx_CyFunctionObject),
32948 : 0,
32949 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
32950 : Py_TPFLAGS_METHOD_DESCRIPTOR |
32951 : #endif
32952 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
32953 : _Py_TPFLAGS_HAVE_VECTORCALL |
32954 : #endif
32955 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32956 : __pyx_CyFunctionType_slots
32957 : };
32958 : #else
32959 : static PyTypeObject __pyx_CyFunctionType_type = {
32960 : PyVarObject_HEAD_INIT(0, 0)
32961 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
32962 : sizeof(__pyx_CyFunctionObject),
32963 : 0,
32964 : (destructor) __Pyx_CyFunction_dealloc,
32965 : #if !CYTHON_METH_FASTCALL
32966 : 0,
32967 : #elif CYTHON_BACKPORT_VECTORCALL
32968 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
32969 : #else
32970 : offsetof(PyCFunctionObject, vectorcall),
32971 : #endif
32972 : 0,
32973 : 0,
32974 : #if PY_MAJOR_VERSION < 3
32975 : 0,
32976 : #else
32977 : 0,
32978 : #endif
32979 : (reprfunc) __Pyx_CyFunction_repr,
32980 : 0,
32981 : 0,
32982 : 0,
32983 : 0,
32984 : __Pyx_CyFunction_CallAsMethod,
32985 : 0,
32986 : 0,
32987 : 0,
32988 : 0,
32989 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
32990 : Py_TPFLAGS_METHOD_DESCRIPTOR |
32991 : #endif
32992 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
32993 : _Py_TPFLAGS_HAVE_VECTORCALL |
32994 : #endif
32995 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
32996 : 0,
32997 : (traverseproc) __Pyx_CyFunction_traverse,
32998 : (inquiry) __Pyx_CyFunction_clear,
32999 : 0,
33000 : #if PY_VERSION_HEX < 0x030500A0
33001 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
33002 : #else
33003 : offsetof(PyCFunctionObject, m_weakreflist),
33004 : #endif
33005 : 0,
33006 : 0,
33007 : __pyx_CyFunction_methods,
33008 : __pyx_CyFunction_members,
33009 : __pyx_CyFunction_getsets,
33010 : 0,
33011 : 0,
33012 : __Pyx_PyMethod_New,
33013 : 0,
33014 : offsetof(__pyx_CyFunctionObject, func_dict),
33015 : 0,
33016 : 0,
33017 : 0,
33018 : 0,
33019 : 0,
33020 : 0,
33021 : 0,
33022 : 0,
33023 : 0,
33024 : 0,
33025 : 0,
33026 : 0,
33027 : #if PY_VERSION_HEX >= 0x030400a1
33028 : 0,
33029 : #endif
33030 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
33031 : 0,
33032 : #endif
33033 : #if __PYX_NEED_TP_PRINT_SLOT
33034 : 0,
33035 : #endif
33036 : #if PY_VERSION_HEX >= 0x030C0000
33037 : 0,
33038 : #endif
33039 : #if PY_VERSION_HEX >= 0x030d00A4
33040 : 0,
33041 : #endif
33042 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
33043 : 0,
33044 : #endif
33045 : };
33046 : #endif
33047 3 : static int __pyx_CyFunction_init(PyObject *module) {
33048 : #if CYTHON_USE_TYPE_SPECS
33049 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
33050 : #else
33051 3 : CYTHON_UNUSED_VAR(module);
33052 3 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
33053 : #endif
33054 3 : if (unlikely(__pyx_CyFunctionType == NULL)) {
33055 0 : return -1;
33056 : }
33057 : return 0;
33058 : }
33059 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
33060 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33061 : m->defaults = PyObject_Malloc(size);
33062 : if (unlikely(!m->defaults))
33063 : return PyErr_NoMemory();
33064 : memset(m->defaults, 0, size);
33065 : m->defaults_pyobjects = pyobjects;
33066 : m->defaults_size = size;
33067 : return m->defaults;
33068 : }
33069 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
33070 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33071 : m->defaults_tuple = tuple;
33072 : Py_INCREF(tuple);
33073 : }
33074 3 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
33075 3 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33076 3 : m->defaults_kwdict = dict;
33077 6 : Py_INCREF(dict);
33078 : }
33079 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
33080 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
33081 : m->func_annotations = dict;
33082 : Py_INCREF(dict);
33083 : }
33084 :
33085 : /* CythonFunction */
33086 18 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
33087 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
33088 18 : PyObject *op = __Pyx_CyFunction_Init(
33089 18 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
33090 : ml, flags, qualname, closure, module, globals, code
33091 : );
33092 18 : if (likely(op)) {
33093 18 : PyObject_GC_Track(op);
33094 : }
33095 18 : return op;
33096 : }
33097 :
33098 : /* CalculateMetaclass */
33099 0 : static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
33100 0 : Py_ssize_t i, nbases;
33101 : #if CYTHON_ASSUME_SAFE_MACROS
33102 0 : nbases = PyTuple_GET_SIZE(bases);
33103 : #else
33104 : nbases = PyTuple_Size(bases);
33105 : if (nbases < 0) return NULL;
33106 : #endif
33107 0 : for (i=0; i < nbases; i++) {
33108 0 : PyTypeObject *tmptype;
33109 : #if CYTHON_ASSUME_SAFE_MACROS
33110 0 : PyObject *tmp = PyTuple_GET_ITEM(bases, i);
33111 : #else
33112 : PyObject *tmp = PyTuple_GetItem(bases, i);
33113 : if (!tmp) return NULL;
33114 : #endif
33115 0 : tmptype = Py_TYPE(tmp);
33116 : #if PY_MAJOR_VERSION < 3
33117 : if (tmptype == &PyClass_Type)
33118 : continue;
33119 : #endif
33120 0 : if (!metaclass) {
33121 0 : metaclass = tmptype;
33122 0 : continue;
33123 : }
33124 0 : if (PyType_IsSubtype(metaclass, tmptype))
33125 0 : continue;
33126 0 : if (PyType_IsSubtype(tmptype, metaclass)) {
33127 0 : metaclass = tmptype;
33128 0 : continue;
33129 : }
33130 0 : PyErr_SetString(PyExc_TypeError,
33131 : "metaclass conflict: "
33132 : "the metaclass of a derived class "
33133 : "must be a (non-strict) subclass "
33134 : "of the metaclasses of all its bases");
33135 0 : return NULL;
33136 : }
33137 0 : if (!metaclass) {
33138 : #if PY_MAJOR_VERSION < 3
33139 : metaclass = &PyClass_Type;
33140 : #else
33141 0 : metaclass = &PyType_Type;
33142 : #endif
33143 : }
33144 0 : Py_INCREF((PyObject*) metaclass);
33145 : return (PyObject*) metaclass;
33146 : }
33147 :
33148 : /* PyObjectCall2Args */
33149 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
33150 : PyObject *args[3] = {NULL, arg1, arg2};
33151 : return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
33152 : }
33153 :
33154 : /* PyObjectLookupSpecial */
33155 : #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
33156 : static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
33157 : PyObject *res;
33158 : PyTypeObject *tp = Py_TYPE(obj);
33159 : #if PY_MAJOR_VERSION < 3
33160 : if (unlikely(PyInstance_Check(obj)))
33161 : return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
33162 : #endif
33163 : res = _PyType_Lookup(tp, attr_name);
33164 : if (likely(res)) {
33165 : descrgetfunc f = Py_TYPE(res)->tp_descr_get;
33166 : if (!f) {
33167 : Py_INCREF(res);
33168 : } else {
33169 : res = f(res, obj, (PyObject *)tp);
33170 : }
33171 : } else if (with_error) {
33172 : PyErr_SetObject(PyExc_AttributeError, attr_name);
33173 : }
33174 : return res;
33175 : }
33176 : #endif
33177 :
33178 : /* Py3ClassCreate */
33179 3 : static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
33180 : PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
33181 3 : PyObject *ns;
33182 3 : if (metaclass) {
33183 0 : PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
33184 0 : if (prep) {
33185 0 : PyObject *pargs[3] = {NULL, name, bases};
33186 0 : ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
33187 0 : Py_DECREF(prep);
33188 : } else {
33189 0 : if (unlikely(PyErr_Occurred()))
33190 : return NULL;
33191 0 : ns = PyDict_New();
33192 : }
33193 : } else {
33194 3 : ns = PyDict_New();
33195 : }
33196 3 : if (unlikely(!ns))
33197 : return NULL;
33198 3 : if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
33199 : #if PY_VERSION_HEX >= 0x03030000
33200 3 : if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
33201 : #else
33202 : CYTHON_MAYBE_UNUSED_VAR(qualname);
33203 : #endif
33204 3 : if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
33205 : return ns;
33206 0 : bad:
33207 0 : Py_DECREF(ns);
33208 : return NULL;
33209 : }
33210 : #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
33211 : static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
33212 : PyTypeObject *type = (PyTypeObject*) type_obj;
33213 : PyObject *names_to_set, *key, *value, *set_name, *tmp;
33214 : Py_ssize_t i = 0;
33215 : #if CYTHON_USE_TYPE_SLOTS
33216 : names_to_set = PyDict_Copy(type->tp_dict);
33217 : #else
33218 : {
33219 : PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
33220 : names_to_set = NULL;
33221 : if (likely(d)) {
33222 : PyObject *names_to_set = PyDict_New();
33223 : int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
33224 : Py_DECREF(d);
33225 : if (unlikely(ret < 0))
33226 : Py_CLEAR(names_to_set);
33227 : }
33228 : }
33229 : #endif
33230 : if (unlikely(names_to_set == NULL))
33231 : goto bad;
33232 : while (PyDict_Next(names_to_set, &i, &key, &value)) {
33233 : set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
33234 : if (unlikely(set_name != NULL)) {
33235 : tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
33236 : Py_DECREF(set_name);
33237 : if (unlikely(tmp == NULL)) {
33238 : __Pyx_TypeName value_type_name =
33239 : __Pyx_PyType_GetName(Py_TYPE(value));
33240 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
33241 : PyErr_Format(PyExc_RuntimeError,
33242 : #if PY_MAJOR_VERSION >= 3
33243 : "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
33244 : value_type_name, key, type_name);
33245 : #else
33246 : "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
33247 : value_type_name,
33248 : PyString_Check(key) ? PyString_AS_STRING(key) : "?",
33249 : type_name);
33250 : #endif
33251 : goto bad;
33252 : } else {
33253 : Py_DECREF(tmp);
33254 : }
33255 : }
33256 : else if (unlikely(PyErr_Occurred())) {
33257 : goto bad;
33258 : }
33259 : }
33260 : Py_DECREF(names_to_set);
33261 : return 0;
33262 : bad:
33263 : Py_XDECREF(names_to_set);
33264 : return -1;
33265 : }
33266 : static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
33267 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33268 : PyTypeObject *type = (PyTypeObject*) type_obj;
33269 : PyObject *mro = type->tp_mro;
33270 : Py_ssize_t i, nbases;
33271 : if (unlikely(!mro)) goto done;
33272 : (void) &__Pyx_GetBuiltinName;
33273 : Py_INCREF(mro);
33274 : nbases = PyTuple_GET_SIZE(mro);
33275 : assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
33276 : for (i = 1; i < nbases-1; i++) {
33277 : PyObject *base, *dict, *meth;
33278 : base = PyTuple_GET_ITEM(mro, i);
33279 : dict = ((PyTypeObject *)base)->tp_dict;
33280 : meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
33281 : if (unlikely(meth)) {
33282 : descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
33283 : PyObject *res;
33284 : Py_INCREF(meth);
33285 : if (likely(f)) {
33286 : res = f(meth, NULL, type_obj);
33287 : Py_DECREF(meth);
33288 : if (unlikely(!res)) goto bad;
33289 : meth = res;
33290 : }
33291 : res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
33292 : Py_DECREF(meth);
33293 : if (unlikely(!res)) goto bad;
33294 : Py_DECREF(res);
33295 : goto done;
33296 : } else if (unlikely(PyErr_Occurred())) {
33297 : goto bad;
33298 : }
33299 : }
33300 : done:
33301 : Py_XDECREF(mro);
33302 : return type_obj;
33303 : bad:
33304 : Py_XDECREF(mro);
33305 : Py_DECREF(type_obj);
33306 : return NULL;
33307 : #else
33308 : PyObject *super_type, *super, *func, *res;
33309 : #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
33310 : super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
33311 : #else
33312 : super_type = (PyObject*) &PySuper_Type;
33313 : (void) &__Pyx_GetBuiltinName;
33314 : #endif
33315 : super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
33316 : #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
33317 : Py_XDECREF(super_type);
33318 : #endif
33319 : if (unlikely(!super)) {
33320 : Py_CLEAR(type_obj);
33321 : goto done;
33322 : }
33323 : func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
33324 : Py_DECREF(super);
33325 : if (likely(!func)) {
33326 : if (unlikely(PyErr_Occurred()))
33327 : Py_CLEAR(type_obj);
33328 : goto done;
33329 : }
33330 : res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
33331 : Py_DECREF(func);
33332 : if (unlikely(!res))
33333 : Py_CLEAR(type_obj);
33334 : Py_XDECREF(res);
33335 : done:
33336 : return type_obj;
33337 : #endif
33338 : }
33339 : #endif
33340 3 : static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
33341 : PyObject *dict, PyObject *mkw,
33342 : int calculate_metaclass, int allow_py2_metaclass) {
33343 3 : PyObject *result;
33344 3 : PyObject *owned_metaclass = NULL;
33345 3 : PyObject *margs[4] = {NULL, name, bases, dict};
33346 3 : if (allow_py2_metaclass) {
33347 0 : owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
33348 0 : if (owned_metaclass) {
33349 : metaclass = owned_metaclass;
33350 0 : } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
33351 0 : PyErr_Clear();
33352 : } else {
33353 : return NULL;
33354 : }
33355 : }
33356 3 : if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
33357 0 : metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
33358 0 : Py_XDECREF(owned_metaclass);
33359 0 : if (unlikely(!metaclass))
33360 : return NULL;
33361 : owned_metaclass = metaclass;
33362 : }
33363 3 : result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
33364 : #if PY_VERSION_HEX < 0x030600A4
33365 : (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
33366 : #else
33367 : mkw
33368 : #endif
33369 : );
33370 3 : Py_XDECREF(owned_metaclass);
33371 : #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
33372 : if (likely(result) && likely(PyType_Check(result))) {
33373 : if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
33374 : Py_CLEAR(result);
33375 : } else {
33376 : result = __Pyx_InitSubclassPEP487(result, mkw);
33377 : }
33378 : }
33379 : #else
33380 3 : (void) &__Pyx_GetBuiltinName;
33381 : #endif
33382 3 : return result;
33383 : }
33384 :
33385 : /* CLineInTraceback */
33386 : #ifndef CYTHON_CLINE_IN_TRACEBACK
33387 17 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
33388 17 : PyObject *use_cline;
33389 17 : PyObject *ptype, *pvalue, *ptraceback;
33390 : #if CYTHON_COMPILING_IN_CPYTHON
33391 17 : PyObject **cython_runtime_dict;
33392 : #endif
33393 17 : CYTHON_MAYBE_UNUSED_VAR(tstate);
33394 17 : if (unlikely(!__pyx_cython_runtime)) {
33395 : return c_line;
33396 : }
33397 17 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33398 : #if CYTHON_COMPILING_IN_CPYTHON
33399 17 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
33400 17 : if (likely(cython_runtime_dict)) {
33401 17 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
33402 : use_cline, *cython_runtime_dict,
33403 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
33404 : } else
33405 : #endif
33406 : {
33407 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
33408 0 : if (use_cline_obj) {
33409 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
33410 0 : Py_DECREF(use_cline_obj);
33411 : } else {
33412 0 : PyErr_Clear();
33413 0 : use_cline = NULL;
33414 : }
33415 : }
33416 17 : if (!use_cline) {
33417 0 : c_line = 0;
33418 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
33419 : }
33420 17 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
33421 : c_line = 0;
33422 : }
33423 17 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33424 17 : return c_line;
33425 : }
33426 : #endif
33427 :
33428 : /* CodeObjectCache */
33429 : #if !CYTHON_COMPILING_IN_LIMITED_API
33430 21 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
33431 21 : int start = 0, mid = 0, end = count - 1;
33432 21 : if (end >= 0 && code_line > entries[end].code_line) {
33433 : return count;
33434 : }
33435 35 : while (start < end) {
33436 22 : mid = start + (end - start) / 2;
33437 22 : if (code_line < entries[mid].code_line) {
33438 : end = mid;
33439 22 : } else if (code_line > entries[mid].code_line) {
33440 22 : start = mid + 1;
33441 : } else {
33442 0 : return mid;
33443 : }
33444 : }
33445 13 : if (code_line <= entries[mid].code_line) {
33446 : return mid;
33447 : } else {
33448 12 : return mid + 1;
33449 : }
33450 : }
33451 17 : static PyCodeObject *__pyx_find_code_object(int code_line) {
33452 17 : PyCodeObject* code_object;
33453 17 : int pos;
33454 17 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
33455 : return NULL;
33456 : }
33457 16 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
33458 16 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
33459 : return NULL;
33460 : }
33461 11 : code_object = __pyx_code_cache.entries[pos].code_object;
33462 11 : Py_INCREF(code_object);
33463 : return code_object;
33464 : }
33465 6 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
33466 6 : int pos, i;
33467 6 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
33468 6 : if (unlikely(!code_line)) {
33469 : return;
33470 : }
33471 6 : if (unlikely(!entries)) {
33472 1 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
33473 1 : if (likely(entries)) {
33474 1 : __pyx_code_cache.entries = entries;
33475 1 : __pyx_code_cache.max_count = 64;
33476 1 : __pyx_code_cache.count = 1;
33477 1 : entries[0].code_line = code_line;
33478 1 : entries[0].code_object = code_object;
33479 1 : Py_INCREF(code_object);
33480 : }
33481 1 : return;
33482 : }
33483 5 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
33484 5 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
33485 0 : PyCodeObject* tmp = entries[pos].code_object;
33486 0 : entries[pos].code_object = code_object;
33487 0 : Py_DECREF(tmp);
33488 0 : return;
33489 : }
33490 5 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
33491 0 : int new_max = __pyx_code_cache.max_count + 64;
33492 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
33493 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
33494 0 : if (unlikely(!entries)) {
33495 : return;
33496 : }
33497 0 : __pyx_code_cache.entries = entries;
33498 0 : __pyx_code_cache.max_count = new_max;
33499 : }
33500 6 : for (i=__pyx_code_cache.count; i>pos; i--) {
33501 1 : entries[i] = entries[i-1];
33502 : }
33503 5 : entries[pos].code_line = code_line;
33504 5 : entries[pos].code_object = code_object;
33505 5 : __pyx_code_cache.count++;
33506 5 : Py_INCREF(code_object);
33507 : }
33508 : #endif
33509 :
33510 : /* AddTraceback */
33511 : #include "compile.h"
33512 : #include "frameobject.h"
33513 : #include "traceback.h"
33514 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
33515 : #ifndef Py_BUILD_CORE
33516 : #define Py_BUILD_CORE 1
33517 : #endif
33518 : #include "internal/pycore_frame.h"
33519 : #endif
33520 : #if CYTHON_COMPILING_IN_LIMITED_API
33521 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
33522 : PyObject *firstlineno, PyObject *name) {
33523 : PyObject *replace = NULL;
33524 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
33525 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
33526 : replace = PyObject_GetAttrString(code, "replace");
33527 : if (likely(replace)) {
33528 : PyObject *result;
33529 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
33530 : Py_DECREF(replace);
33531 : return result;
33532 : }
33533 : PyErr_Clear();
33534 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
33535 : {
33536 : PyObject *compiled = NULL, *result = NULL;
33537 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
33538 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
33539 : compiled = Py_CompileString(
33540 : "out = type(code)(\n"
33541 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
33542 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
33543 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
33544 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
33545 : if (!compiled) return NULL;
33546 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
33547 : Py_DECREF(compiled);
33548 : if (!result) PyErr_Print();
33549 : Py_DECREF(result);
33550 : result = PyDict_GetItemString(scratch_dict, "out");
33551 : if (result) Py_INCREF(result);
33552 : return result;
33553 : }
33554 : #else
33555 : return NULL;
33556 : #endif
33557 : }
33558 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
33559 : int py_line, const char *filename) {
33560 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
33561 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
33562 : PyObject *exc_type, *exc_value, *exc_traceback;
33563 : int success = 0;
33564 : if (c_line) {
33565 : (void) __pyx_cfilenm;
33566 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
33567 : }
33568 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
33569 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
33570 : if (unlikely(!code_object)) goto bad;
33571 : py_py_line = PyLong_FromLong(py_line);
33572 : if (unlikely(!py_py_line)) goto bad;
33573 : py_funcname = PyUnicode_FromString(funcname);
33574 : if (unlikely(!py_funcname)) goto bad;
33575 : dict = PyDict_New();
33576 : if (unlikely(!dict)) goto bad;
33577 : {
33578 : PyObject *old_code_object = code_object;
33579 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
33580 : Py_DECREF(old_code_object);
33581 : }
33582 : if (unlikely(!code_object)) goto bad;
33583 : getframe = PySys_GetObject("_getframe");
33584 : if (unlikely(!getframe)) goto bad;
33585 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
33586 : frame = PyEval_EvalCode(code_object, dict, dict);
33587 : if (unlikely(!frame) || frame == Py_None) goto bad;
33588 : success = 1;
33589 : bad:
33590 : PyErr_Restore(exc_type, exc_value, exc_traceback);
33591 : Py_XDECREF(code_object);
33592 : Py_XDECREF(py_py_line);
33593 : Py_XDECREF(py_funcname);
33594 : Py_XDECREF(dict);
33595 : Py_XDECREF(replace);
33596 : if (success) {
33597 : PyTraceBack_Here(
33598 : (struct _frame*)frame);
33599 : }
33600 : Py_XDECREF(frame);
33601 : }
33602 : #else
33603 6 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
33604 : const char *funcname, int c_line,
33605 : int py_line, const char *filename) {
33606 6 : PyCodeObject *py_code = NULL;
33607 6 : PyObject *py_funcname = NULL;
33608 : #if PY_MAJOR_VERSION < 3
33609 : PyObject *py_srcfile = NULL;
33610 : py_srcfile = PyString_FromString(filename);
33611 : if (!py_srcfile) goto bad;
33612 : #endif
33613 6 : if (c_line) {
33614 : #if PY_MAJOR_VERSION < 3
33615 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33616 : if (!py_funcname) goto bad;
33617 : #else
33618 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
33619 0 : if (!py_funcname) goto bad;
33620 0 : funcname = PyUnicode_AsUTF8(py_funcname);
33621 0 : if (!funcname) goto bad;
33622 : #endif
33623 : }
33624 : else {
33625 : #if PY_MAJOR_VERSION < 3
33626 : py_funcname = PyString_FromString(funcname);
33627 : if (!py_funcname) goto bad;
33628 : #endif
33629 6 : }
33630 : #if PY_MAJOR_VERSION < 3
33631 : py_code = __Pyx_PyCode_New(
33632 : 0,
33633 : 0,
33634 : 0,
33635 : 0,
33636 : 0,
33637 : 0,
33638 : __pyx_empty_bytes, /*PyObject *code,*/
33639 : __pyx_empty_tuple, /*PyObject *consts,*/
33640 : __pyx_empty_tuple, /*PyObject *names,*/
33641 : __pyx_empty_tuple, /*PyObject *varnames,*/
33642 : __pyx_empty_tuple, /*PyObject *freevars,*/
33643 : __pyx_empty_tuple, /*PyObject *cellvars,*/
33644 : py_srcfile, /*PyObject *filename,*/
33645 : py_funcname, /*PyObject *name,*/
33646 : py_line,
33647 : __pyx_empty_bytes /*PyObject *lnotab*/
33648 : );
33649 : Py_DECREF(py_srcfile);
33650 : #else
33651 6 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
33652 : #endif
33653 6 : Py_XDECREF(py_funcname);
33654 6 : return py_code;
33655 0 : bad:
33656 0 : Py_XDECREF(py_funcname);
33657 : #if PY_MAJOR_VERSION < 3
33658 : Py_XDECREF(py_srcfile);
33659 : #endif
33660 0 : return NULL;
33661 : }
33662 17 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
33663 : int py_line, const char *filename) {
33664 17 : PyCodeObject *py_code = 0;
33665 17 : PyFrameObject *py_frame = 0;
33666 17 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
33667 17 : PyObject *ptype, *pvalue, *ptraceback;
33668 17 : if (c_line) {
33669 17 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
33670 : }
33671 34 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
33672 17 : if (!py_code) {
33673 6 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
33674 6 : py_code = __Pyx_CreateCodeObjectForTraceback(
33675 : funcname, c_line, py_line, filename);
33676 6 : if (!py_code) {
33677 : /* If the code object creation fails, then we should clear the
33678 : fetched exception references and propagate the new exception */
33679 0 : Py_XDECREF(ptype);
33680 0 : Py_XDECREF(pvalue);
33681 0 : Py_XDECREF(ptraceback);
33682 0 : goto bad;
33683 : }
33684 6 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
33685 6 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
33686 : }
33687 34 : py_frame = PyFrame_New(
33688 : tstate, /*PyThreadState *tstate,*/
33689 : py_code, /*PyCodeObject *code,*/
33690 17 : __pyx_d, /*PyObject *globals,*/
33691 : 0 /*PyObject *locals*/
33692 : );
33693 17 : if (!py_frame) goto bad;
33694 17 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
33695 17 : PyTraceBack_Here(py_frame);
33696 17 : bad:
33697 17 : Py_XDECREF(py_code);
33698 17 : Py_XDECREF(py_frame);
33699 17 : }
33700 : #endif
33701 :
33702 : #if PY_MAJOR_VERSION < 3
33703 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
33704 : __Pyx_TypeName obj_type_name;
33705 : if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
33706 : if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
33707 : if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
33708 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
33709 : PyErr_Format(PyExc_TypeError,
33710 : "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
33711 : obj_type_name);
33712 : __Pyx_DECREF_TypeName(obj_type_name);
33713 : return -1;
33714 : }
33715 : static void __Pyx_ReleaseBuffer(Py_buffer *view) {
33716 : PyObject *obj = view->obj;
33717 : if (!obj) return;
33718 : if (PyObject_CheckBuffer(obj)) {
33719 : PyBuffer_Release(view);
33720 : return;
33721 : }
33722 : if ((0)) {}
33723 : view->obj = NULL;
33724 : Py_DECREF(obj);
33725 : }
33726 : #endif
33727 :
33728 :
33729 : /* MemviewSliceIsContig */
33730 : static int
33731 0 : __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
33732 : {
33733 0 : int i, index, step, start;
33734 0 : Py_ssize_t itemsize = mvs.memview->view.itemsize;
33735 0 : if (order == 'F') {
33736 : step = 1;
33737 : start = 0;
33738 : } else {
33739 0 : step = -1;
33740 0 : start = ndim - 1;
33741 : }
33742 0 : for (i = 0; i < ndim; i++) {
33743 0 : index = start + step * i;
33744 0 : if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
33745 : return 0;
33746 0 : itemsize *= mvs.shape[index];
33747 : }
33748 : return 1;
33749 : }
33750 :
33751 : /* OverlappingSlices */
33752 : static void
33753 0 : __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
33754 : void **out_start, void **out_end,
33755 : int ndim, size_t itemsize)
33756 : {
33757 0 : char *start, *end;
33758 0 : int i;
33759 0 : start = end = slice->data;
33760 0 : for (i = 0; i < ndim; i++) {
33761 0 : Py_ssize_t stride = slice->strides[i];
33762 0 : Py_ssize_t extent = slice->shape[i];
33763 0 : if (extent == 0) {
33764 0 : *out_start = *out_end = start;
33765 0 : return;
33766 : } else {
33767 0 : if (stride > 0)
33768 0 : end += stride * (extent - 1);
33769 : else
33770 0 : start += stride * (extent - 1);
33771 : }
33772 : }
33773 0 : *out_start = start;
33774 0 : *out_end = end + itemsize;
33775 : }
33776 : static int
33777 0 : __pyx_slices_overlap(__Pyx_memviewslice *slice1,
33778 : __Pyx_memviewslice *slice2,
33779 : int ndim, size_t itemsize)
33780 : {
33781 0 : void *start1, *end1, *start2, *end2;
33782 0 : __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
33783 0 : __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
33784 0 : return (start1 < end2) && (start2 < end1);
33785 : }
33786 :
33787 : /* IsLittleEndian */
33788 0 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
33789 : {
33790 0 : union {
33791 : uint32_t u32;
33792 : uint8_t u8[4];
33793 : } S;
33794 0 : S.u32 = 0x01020304;
33795 0 : return S.u8[0] == 4;
33796 : }
33797 :
33798 : /* BufferFormatCheck */
33799 314 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
33800 : __Pyx_BufFmt_StackElem* stack,
33801 : __Pyx_TypeInfo* type) {
33802 314 : stack[0].field = &ctx->root;
33803 314 : stack[0].parent_offset = 0;
33804 314 : ctx->root.type = type;
33805 314 : ctx->root.name = "buffer dtype";
33806 314 : ctx->root.offset = 0;
33807 314 : ctx->head = stack;
33808 314 : ctx->head->field = &ctx->root;
33809 314 : ctx->fmt_offset = 0;
33810 314 : ctx->head->parent_offset = 0;
33811 314 : ctx->new_packmode = '@';
33812 314 : ctx->enc_packmode = '@';
33813 314 : ctx->new_count = 1;
33814 314 : ctx->enc_count = 0;
33815 314 : ctx->enc_type = 0;
33816 314 : ctx->is_complex = 0;
33817 314 : ctx->is_valid_array = 0;
33818 314 : ctx->struct_alignment = 0;
33819 314 : while (type->typegroup == 'S') {
33820 0 : ++ctx->head;
33821 0 : ctx->head->field = type->fields;
33822 0 : ctx->head->parent_offset = 0;
33823 0 : type = type->fields->type;
33824 : }
33825 314 : }
33826 0 : static int __Pyx_BufFmt_ParseNumber(const char** ts) {
33827 0 : int count;
33828 0 : const char* t = *ts;
33829 0 : if (*t < '0' || *t > '9') {
33830 : return -1;
33831 : } else {
33832 0 : count = *t++ - '0';
33833 0 : while (*t >= '0' && *t <= '9') {
33834 0 : count *= 10;
33835 0 : count += *t++ - '0';
33836 : }
33837 : }
33838 0 : *ts = t;
33839 0 : return count;
33840 : }
33841 0 : static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
33842 0 : int number = __Pyx_BufFmt_ParseNumber(ts);
33843 0 : if (number == -1)
33844 0 : PyErr_Format(PyExc_ValueError,\
33845 0 : "Does not understand character buffer dtype format string ('%c')", **ts);
33846 0 : return number;
33847 : }
33848 0 : static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
33849 0 : PyErr_Format(PyExc_ValueError,
33850 : "Unexpected format string character: '%c'", ch);
33851 : }
33852 0 : static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
33853 0 : switch (ch) {
33854 : case '?': return "'bool'";
33855 0 : case 'c': return "'char'";
33856 0 : case 'b': return "'signed char'";
33857 0 : case 'B': return "'unsigned char'";
33858 0 : case 'h': return "'short'";
33859 0 : case 'H': return "'unsigned short'";
33860 0 : case 'i': return "'int'";
33861 0 : case 'I': return "'unsigned int'";
33862 0 : case 'l': return "'long'";
33863 0 : case 'L': return "'unsigned long'";
33864 0 : case 'q': return "'long long'";
33865 0 : case 'Q': return "'unsigned long long'";
33866 0 : case 'f': return (is_complex ? "'complex float'" : "'float'");
33867 0 : case 'd': return (is_complex ? "'complex double'" : "'double'");
33868 0 : case 'g': return (is_complex ? "'complex long double'" : "'long double'");
33869 0 : case 'T': return "a struct";
33870 0 : case 'O': return "Python object";
33871 0 : case 'P': return "a pointer";
33872 0 : case 's': case 'p': return "a string";
33873 0 : case 0: return "end";
33874 0 : default: return "unparsable format string";
33875 : }
33876 : }
33877 0 : static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
33878 0 : switch (ch) {
33879 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33880 0 : case 'h': case 'H': return 2;
33881 : case 'i': case 'I': case 'l': case 'L': return 4;
33882 : case 'q': case 'Q': return 8;
33883 0 : case 'f': return (is_complex ? 8 : 4);
33884 0 : case 'd': return (is_complex ? 16 : 8);
33885 0 : case 'g': {
33886 0 : PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
33887 0 : return 0;
33888 : }
33889 : case 'O': case 'P': return sizeof(void*);
33890 0 : default:
33891 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33892 0 : return 0;
33893 : }
33894 : }
33895 314 : static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
33896 314 : switch (ch) {
33897 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33898 0 : case 'h': case 'H': return sizeof(short);
33899 : case 'i': case 'I': return sizeof(int);
33900 : case 'l': case 'L': return sizeof(long);
33901 : #ifdef HAVE_LONG_LONG
33902 : case 'q': case 'Q': return sizeof(PY_LONG_LONG);
33903 : #endif
33904 0 : case 'f': return sizeof(float) * (is_complex ? 2 : 1);
33905 0 : case 'd': return sizeof(double) * (is_complex ? 2 : 1);
33906 0 : case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
33907 : case 'O': case 'P': return sizeof(void*);
33908 0 : default: {
33909 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33910 0 : return 0;
33911 : }
33912 : }
33913 : }
33914 : typedef struct { char c; short x; } __Pyx_st_short;
33915 : typedef struct { char c; int x; } __Pyx_st_int;
33916 : typedef struct { char c; long x; } __Pyx_st_long;
33917 : typedef struct { char c; float x; } __Pyx_st_float;
33918 : typedef struct { char c; double x; } __Pyx_st_double;
33919 : typedef struct { char c; long double x; } __Pyx_st_longdouble;
33920 : typedef struct { char c; void *x; } __Pyx_st_void_p;
33921 : #ifdef HAVE_LONG_LONG
33922 : typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
33923 : #endif
33924 314 : static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
33925 314 : CYTHON_UNUSED_VAR(is_complex);
33926 314 : switch (ch) {
33927 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33928 0 : case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
33929 : case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
33930 : case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
33931 : #ifdef HAVE_LONG_LONG
33932 : case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
33933 : #endif
33934 : case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
33935 : case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
33936 0 : case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
33937 : case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
33938 0 : default:
33939 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33940 0 : return 0;
33941 : }
33942 : }
33943 : /* These are for computing the padding at the end of the struct to align
33944 : on the first member of the struct. This will probably the same as above,
33945 : but we don't have any guarantees.
33946 : */
33947 : typedef struct { short x; char c; } __Pyx_pad_short;
33948 : typedef struct { int x; char c; } __Pyx_pad_int;
33949 : typedef struct { long x; char c; } __Pyx_pad_long;
33950 : typedef struct { float x; char c; } __Pyx_pad_float;
33951 : typedef struct { double x; char c; } __Pyx_pad_double;
33952 : typedef struct { long double x; char c; } __Pyx_pad_longdouble;
33953 : typedef struct { void *x; char c; } __Pyx_pad_void_p;
33954 : #ifdef HAVE_LONG_LONG
33955 : typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
33956 : #endif
33957 314 : static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
33958 314 : CYTHON_UNUSED_VAR(is_complex);
33959 314 : switch (ch) {
33960 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
33961 0 : case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
33962 : case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
33963 : case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
33964 : #ifdef HAVE_LONG_LONG
33965 : case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
33966 : #endif
33967 : case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
33968 : case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
33969 0 : case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
33970 : case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
33971 0 : default:
33972 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33973 0 : return 0;
33974 : }
33975 : }
33976 314 : static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
33977 314 : switch (ch) {
33978 : case 'c':
33979 : return 'H';
33980 314 : case 'b': case 'h': case 'i':
33981 : case 'l': case 'q': case 's': case 'p':
33982 314 : return 'I';
33983 0 : case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
33984 0 : return 'U';
33985 0 : case 'f': case 'd': case 'g':
33986 0 : return (is_complex ? 'C' : 'R');
33987 0 : case 'O':
33988 0 : return 'O';
33989 0 : case 'P':
33990 0 : return 'P';
33991 0 : default: {
33992 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
33993 0 : return 0;
33994 : }
33995 : }
33996 : }
33997 0 : static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
33998 0 : if (ctx->head == NULL || ctx->head->field == &ctx->root) {
33999 0 : const char* expected;
34000 0 : const char* quote;
34001 0 : if (ctx->head == NULL) {
34002 : expected = "end";
34003 : quote = "";
34004 : } else {
34005 0 : expected = ctx->head->field->type->name;
34006 0 : quote = "'";
34007 : }
34008 0 : PyErr_Format(PyExc_ValueError,
34009 : "Buffer dtype mismatch, expected %s%s%s but got %s",
34010 : quote, expected, quote,
34011 0 : __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
34012 : } else {
34013 0 : __Pyx_StructField* field = ctx->head->field;
34014 0 : __Pyx_StructField* parent = (ctx->head - 1)->field;
34015 0 : PyErr_Format(PyExc_ValueError,
34016 : "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
34017 0 : field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
34018 0 : parent->type->name, field->name);
34019 : }
34020 0 : }
34021 628 : static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
34022 628 : char group;
34023 628 : size_t size, offset, arraysize = 1;
34024 628 : if (ctx->enc_type == 0) return 0;
34025 314 : if (ctx->head->field->type->arraysize[0]) {
34026 0 : int i, ndim = 0;
34027 0 : if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
34028 0 : ctx->is_valid_array = ctx->head->field->type->ndim == 1;
34029 0 : ndim = 1;
34030 0 : if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
34031 0 : PyErr_Format(PyExc_ValueError,
34032 : "Expected a dimension of size %zu, got %zu",
34033 : ctx->head->field->type->arraysize[0], ctx->enc_count);
34034 0 : return -1;
34035 : }
34036 : }
34037 0 : if (!ctx->is_valid_array) {
34038 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
34039 : ctx->head->field->type->ndim, ndim);
34040 0 : return -1;
34041 : }
34042 0 : for (i = 0; i < ctx->head->field->type->ndim; i++) {
34043 0 : arraysize *= ctx->head->field->type->arraysize[i];
34044 : }
34045 0 : ctx->is_valid_array = 0;
34046 0 : ctx->enc_count = 1;
34047 : }
34048 314 : group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
34049 314 : do {
34050 314 : __Pyx_StructField* field = ctx->head->field;
34051 314 : __Pyx_TypeInfo* type = field->type;
34052 314 : if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
34053 314 : size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
34054 : } else {
34055 0 : size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
34056 : }
34057 314 : if (ctx->enc_packmode == '@') {
34058 314 : size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
34059 314 : size_t align_mod_offset;
34060 314 : if (align_at == 0) return -1;
34061 314 : align_mod_offset = ctx->fmt_offset % align_at;
34062 314 : if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
34063 314 : if (ctx->struct_alignment == 0)
34064 314 : ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
34065 : ctx->is_complex);
34066 : }
34067 314 : if (type->size != size || type->typegroup != group) {
34068 0 : if (type->typegroup == 'C' && type->fields != NULL) {
34069 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
34070 0 : ++ctx->head;
34071 0 : ctx->head->field = type->fields;
34072 0 : ctx->head->parent_offset = parent_offset;
34073 0 : continue;
34074 : }
34075 0 : if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
34076 : } else {
34077 0 : __Pyx_BufFmt_RaiseExpected(ctx);
34078 0 : return -1;
34079 : }
34080 : }
34081 314 : offset = ctx->head->parent_offset + field->offset;
34082 314 : if (ctx->fmt_offset != offset) {
34083 0 : PyErr_Format(PyExc_ValueError,
34084 : "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
34085 : (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
34086 0 : return -1;
34087 : }
34088 314 : ctx->fmt_offset += size;
34089 314 : if (arraysize)
34090 314 : ctx->fmt_offset += (arraysize - 1) * size;
34091 314 : --ctx->enc_count;
34092 314 : while (1) {
34093 314 : if (field == &ctx->root) {
34094 314 : ctx->head = NULL;
34095 314 : if (ctx->enc_count != 0) {
34096 0 : __Pyx_BufFmt_RaiseExpected(ctx);
34097 0 : return -1;
34098 : }
34099 : break;
34100 : }
34101 0 : ctx->head->field = ++field;
34102 0 : if (field->type == NULL) {
34103 0 : --ctx->head;
34104 0 : field = ctx->head->field;
34105 0 : continue;
34106 0 : } else if (field->type->typegroup == 'S') {
34107 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
34108 0 : if (field->type->fields->type == NULL) continue;
34109 0 : field = field->type->fields;
34110 0 : ++ctx->head;
34111 0 : ctx->head->field = field;
34112 0 : ctx->head->parent_offset = parent_offset;
34113 0 : break;
34114 : } else {
34115 : break;
34116 : }
34117 : }
34118 314 : } while (ctx->enc_count);
34119 314 : ctx->enc_type = 0;
34120 314 : ctx->is_complex = 0;
34121 314 : return 0;
34122 : }
34123 : static int
34124 0 : __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
34125 : {
34126 0 : const char *ts = *tsp;
34127 0 : int i = 0, number, ndim;
34128 0 : ++ts;
34129 0 : if (ctx->new_count != 1) {
34130 0 : PyErr_SetString(PyExc_ValueError,
34131 : "Cannot handle repeated arrays in format string");
34132 0 : return -1;
34133 : }
34134 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
34135 0 : ndim = ctx->head->field->type->ndim;
34136 0 : while (*ts && *ts != ')') {
34137 0 : switch (*ts) {
34138 0 : case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
34139 0 : default: break;
34140 : }
34141 0 : number = __Pyx_BufFmt_ExpectNumber(&ts);
34142 0 : if (number == -1) return -1;
34143 0 : if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
34144 0 : PyErr_Format(PyExc_ValueError,
34145 : "Expected a dimension of size %zu, got %d",
34146 : ctx->head->field->type->arraysize[i], number);
34147 0 : return -1;
34148 : }
34149 0 : if (*ts != ',' && *ts != ')') {
34150 0 : PyErr_Format(PyExc_ValueError,
34151 : "Expected a comma in format string, got '%c'", *ts);
34152 0 : return -1;
34153 : }
34154 0 : if (*ts == ',') ts++;
34155 0 : i++;
34156 : }
34157 0 : if (i != ndim) {
34158 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
34159 0 : ctx->head->field->type->ndim, i);
34160 0 : return -1;
34161 : }
34162 0 : if (!*ts) {
34163 0 : PyErr_SetString(PyExc_ValueError,
34164 : "Unexpected end of format string, expected ')'");
34165 0 : return -1;
34166 : }
34167 0 : ctx->is_valid_array = 1;
34168 0 : ctx->new_count = 1;
34169 0 : *tsp = ++ts;
34170 0 : return 0;
34171 : }
34172 314 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
34173 314 : int got_Z = 0;
34174 628 : while (1) {
34175 628 : switch(*ts) {
34176 314 : case 0:
34177 314 : if (ctx->enc_type != 0 && ctx->head == NULL) {
34178 0 : __Pyx_BufFmt_RaiseExpected(ctx);
34179 0 : return NULL;
34180 : }
34181 314 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34182 314 : if (ctx->head != NULL) {
34183 0 : __Pyx_BufFmt_RaiseExpected(ctx);
34184 0 : return NULL;
34185 : }
34186 : return ts;
34187 0 : case ' ':
34188 : case '\r':
34189 : case '\n':
34190 0 : ++ts;
34191 0 : break;
34192 : case '<':
34193 0 : if (!__Pyx_Is_Little_Endian()) {
34194 : PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
34195 : return NULL;
34196 : }
34197 0 : ctx->new_packmode = '=';
34198 0 : ++ts;
34199 0 : break;
34200 : case '>':
34201 : case '!':
34202 0 : if (__Pyx_Is_Little_Endian()) {
34203 0 : PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
34204 0 : return NULL;
34205 : }
34206 : ctx->new_packmode = '=';
34207 : ++ts;
34208 : break;
34209 0 : case '=':
34210 : case '@':
34211 : case '^':
34212 0 : ctx->new_packmode = *ts++;
34213 0 : break;
34214 0 : case 'T':
34215 : {
34216 0 : const char* ts_after_sub;
34217 0 : size_t i, struct_count = ctx->new_count;
34218 0 : size_t struct_alignment = ctx->struct_alignment;
34219 0 : ctx->new_count = 1;
34220 0 : ++ts;
34221 0 : if (*ts != '{') {
34222 0 : PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
34223 0 : return NULL;
34224 : }
34225 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34226 0 : ctx->enc_type = 0;
34227 0 : ctx->enc_count = 0;
34228 0 : ctx->struct_alignment = 0;
34229 0 : ++ts;
34230 0 : ts_after_sub = ts;
34231 0 : for (i = 0; i != struct_count; ++i) {
34232 0 : ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
34233 0 : if (!ts_after_sub) return NULL;
34234 : }
34235 0 : ts = ts_after_sub;
34236 0 : if (struct_alignment) ctx->struct_alignment = struct_alignment;
34237 : }
34238 : break;
34239 0 : case '}':
34240 : {
34241 0 : size_t alignment = ctx->struct_alignment;
34242 0 : ++ts;
34243 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34244 0 : ctx->enc_type = 0;
34245 0 : if (alignment && ctx->fmt_offset % alignment) {
34246 0 : ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
34247 : }
34248 : }
34249 : return ts;
34250 0 : case 'x':
34251 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34252 0 : ctx->fmt_offset += ctx->new_count;
34253 0 : ctx->new_count = 1;
34254 0 : ctx->enc_count = 0;
34255 0 : ctx->enc_type = 0;
34256 0 : ctx->enc_packmode = ctx->new_packmode;
34257 0 : ++ts;
34258 0 : break;
34259 0 : case 'Z':
34260 0 : got_Z = 1;
34261 0 : ++ts;
34262 0 : if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
34263 0 : __Pyx_BufFmt_RaiseUnexpectedChar('Z');
34264 0 : return NULL;
34265 : }
34266 314 : CYTHON_FALLTHROUGH;
34267 : case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
34268 : case 'l': case 'L': case 'q': case 'Q':
34269 : case 'f': case 'd': case 'g':
34270 : case 'O': case 'p':
34271 314 : if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
34272 0 : (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
34273 0 : ctx->enc_count += ctx->new_count;
34274 0 : ctx->new_count = 1;
34275 0 : got_Z = 0;
34276 0 : ++ts;
34277 0 : break;
34278 : }
34279 314 : CYTHON_FALLTHROUGH;
34280 : case 's':
34281 314 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
34282 314 : ctx->enc_count = ctx->new_count;
34283 314 : ctx->enc_packmode = ctx->new_packmode;
34284 314 : ctx->enc_type = *ts;
34285 314 : ctx->is_complex = got_Z;
34286 314 : ++ts;
34287 314 : ctx->new_count = 1;
34288 314 : got_Z = 0;
34289 314 : break;
34290 0 : case ':':
34291 0 : ++ts;
34292 0 : while(*ts != ':') ++ts;
34293 0 : ++ts;
34294 0 : break;
34295 0 : case '(':
34296 0 : if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
34297 : break;
34298 0 : default:
34299 : {
34300 0 : int number = __Pyx_BufFmt_ExpectNumber(&ts);
34301 0 : if (number == -1) return NULL;
34302 0 : ctx->new_count = (size_t)number;
34303 : }
34304 : }
34305 : }
34306 : }
34307 :
34308 : /* TypeInfoCompare */
34309 : static int
34310 8 : __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
34311 : {
34312 8 : int i;
34313 8 : if (!a || !b)
34314 : return 0;
34315 8 : if (a == b)
34316 : return 1;
34317 8 : if (a->size != b->size || a->typegroup != b->typegroup ||
34318 8 : a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
34319 0 : if (a->typegroup == 'H' || b->typegroup == 'H') {
34320 0 : return a->size == b->size;
34321 : } else {
34322 : return 0;
34323 : }
34324 : }
34325 8 : if (a->ndim) {
34326 0 : for (i = 0; i < a->ndim; i++)
34327 0 : if (a->arraysize[i] != b->arraysize[i])
34328 : return 0;
34329 : }
34330 8 : if (a->typegroup == 'S') {
34331 0 : if (a->flags != b->flags)
34332 : return 0;
34333 0 : if (a->fields || b->fields) {
34334 0 : if (!(a->fields && b->fields))
34335 : return 0;
34336 0 : for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
34337 0 : __Pyx_StructField *field_a = a->fields + i;
34338 0 : __Pyx_StructField *field_b = b->fields + i;
34339 0 : if (field_a->offset != field_b->offset ||
34340 0 : !__pyx_typeinfo_cmp(field_a->type, field_b->type))
34341 0 : return 0;
34342 : }
34343 0 : return !a->fields[i].type && !b->fields[i].type;
34344 : }
34345 : }
34346 : return 1;
34347 : }
34348 :
34349 : /* MemviewSliceValidateAndInit */
34350 : static int
34351 318 : __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
34352 : {
34353 318 : if (buf->shape[dim] <= 1)
34354 : return 1;
34355 299 : if (buf->strides) {
34356 299 : if (spec & __Pyx_MEMVIEW_CONTIG) {
34357 0 : if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
34358 0 : if (unlikely(buf->strides[dim] != sizeof(void *))) {
34359 0 : PyErr_Format(PyExc_ValueError,
34360 : "Buffer is not indirectly contiguous "
34361 : "in dimension %d.", dim);
34362 0 : goto fail;
34363 : }
34364 0 : } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
34365 0 : PyErr_SetString(PyExc_ValueError,
34366 : "Buffer and memoryview are not contiguous "
34367 : "in the same dimension.");
34368 0 : goto fail;
34369 : }
34370 : }
34371 299 : if (spec & __Pyx_MEMVIEW_FOLLOW) {
34372 0 : Py_ssize_t stride = buf->strides[dim];
34373 0 : if (stride < 0)
34374 : stride = -stride;
34375 0 : if (unlikely(stride < buf->itemsize)) {
34376 0 : PyErr_SetString(PyExc_ValueError,
34377 : "Buffer and memoryview are not contiguous "
34378 : "in the same dimension.");
34379 0 : goto fail;
34380 : }
34381 : }
34382 : } else {
34383 0 : if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
34384 0 : PyErr_Format(PyExc_ValueError,
34385 : "C-contiguous buffer is not contiguous in "
34386 : "dimension %d", dim);
34387 0 : goto fail;
34388 0 : } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
34389 0 : PyErr_Format(PyExc_ValueError,
34390 : "C-contiguous buffer is not indirect in "
34391 : "dimension %d", dim);
34392 0 : goto fail;
34393 0 : } else if (unlikely(buf->suboffsets)) {
34394 0 : PyErr_SetString(PyExc_ValueError,
34395 : "Buffer exposes suboffsets but no strides");
34396 0 : goto fail;
34397 : }
34398 : }
34399 : return 1;
34400 : fail:
34401 : return 0;
34402 : }
34403 : static int
34404 318 : __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
34405 : {
34406 318 : CYTHON_UNUSED_VAR(ndim);
34407 318 : if (spec & __Pyx_MEMVIEW_DIRECT) {
34408 318 : if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
34409 0 : PyErr_Format(PyExc_ValueError,
34410 : "Buffer not compatible with direct access "
34411 : "in dimension %d.", dim);
34412 0 : goto fail;
34413 : }
34414 : }
34415 318 : if (spec & __Pyx_MEMVIEW_PTR) {
34416 0 : if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
34417 0 : PyErr_Format(PyExc_ValueError,
34418 : "Buffer is not indirectly accessible "
34419 : "in dimension %d.", dim);
34420 0 : goto fail;
34421 : }
34422 : }
34423 : return 1;
34424 : fail:
34425 : return 0;
34426 : }
34427 : static int
34428 310 : __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
34429 : {
34430 310 : int i;
34431 310 : if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
34432 : Py_ssize_t stride = 1;
34433 0 : for (i = 0; i < ndim; i++) {
34434 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
34435 0 : PyErr_SetString(PyExc_ValueError,
34436 : "Buffer not fortran contiguous.");
34437 0 : goto fail;
34438 : }
34439 0 : stride = stride * buf->shape[i];
34440 : }
34441 310 : } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
34442 0 : Py_ssize_t stride = 1;
34443 0 : for (i = ndim - 1; i >- 1; i--) {
34444 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
34445 0 : PyErr_SetString(PyExc_ValueError,
34446 : "Buffer not C contiguous.");
34447 0 : goto fail;
34448 : }
34449 0 : stride = stride * buf->shape[i];
34450 : }
34451 : }
34452 : return 1;
34453 : fail:
34454 : return 0;
34455 : }
34456 322 : static int __Pyx_ValidateAndInit_memviewslice(
34457 : int *axes_specs,
34458 : int c_or_f_flag,
34459 : int buf_flags,
34460 : int ndim,
34461 : __Pyx_TypeInfo *dtype,
34462 : __Pyx_BufFmt_StackElem stack[],
34463 : __Pyx_memviewslice *memviewslice,
34464 : PyObject *original_obj)
34465 : {
34466 322 : struct __pyx_memoryview_obj *memview, *new_memview;
34467 : __Pyx_RefNannyDeclarations
34468 322 : Py_buffer *buf;
34469 322 : int i, spec = 0, retval = -1;
34470 322 : __Pyx_BufFmt_Context ctx;
34471 322 : int from_memoryview = __pyx_memoryview_check(original_obj);
34472 322 : __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
34473 322 : if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
34474 : original_obj)->typeinfo)) {
34475 : memview = (struct __pyx_memoryview_obj *) original_obj;
34476 : new_memview = NULL;
34477 : } else {
34478 314 : memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
34479 : original_obj, buf_flags, 0, dtype);
34480 314 : new_memview = memview;
34481 314 : if (unlikely(!memview))
34482 0 : goto fail;
34483 : }
34484 322 : buf = &memview->view;
34485 322 : if (unlikely(buf->ndim != ndim)) {
34486 0 : PyErr_Format(PyExc_ValueError,
34487 : "Buffer has wrong number of dimensions (expected %d, got %d)",
34488 : ndim, buf->ndim);
34489 0 : goto fail;
34490 : }
34491 322 : if (new_memview) {
34492 314 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
34493 314 : if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
34494 : }
34495 322 : if (unlikely((unsigned) buf->itemsize != dtype->size)) {
34496 0 : PyErr_Format(PyExc_ValueError,
34497 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
34498 : "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
34499 : buf->itemsize,
34500 : (buf->itemsize > 1) ? "s" : "",
34501 : dtype->name,
34502 : dtype->size,
34503 : (dtype->size > 1) ? "s" : "");
34504 0 : goto fail;
34505 : }
34506 322 : if (buf->len > 0) {
34507 628 : for (i = 0; i < ndim; i++) {
34508 318 : spec = axes_specs[i];
34509 318 : if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
34510 0 : goto fail;
34511 318 : if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
34512 0 : goto fail;
34513 : }
34514 310 : if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
34515 0 : goto fail;
34516 : }
34517 322 : if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
34518 : new_memview != NULL) == -1)) {
34519 0 : goto fail;
34520 : }
34521 322 : retval = 0;
34522 322 : goto no_fail;
34523 0 : fail:
34524 0 : Py_XDECREF(new_memview);
34525 0 : retval = -1;
34526 322 : no_fail:
34527 322 : __Pyx_RefNannyFinishContext();
34528 322 : return retval;
34529 : }
34530 :
34531 : /* ObjectToMemviewSlice */
34532 64 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__(PyObject *obj, int writable_flag) {
34533 64 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34534 64 : __Pyx_BufFmt_StackElem stack[1];
34535 64 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34536 64 : int retcode;
34537 64 : if (obj == Py_None) {
34538 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34539 0 : return result;
34540 : }
34541 64 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34542 : PyBUF_RECORDS_RO | writable_flag, 1,
34543 : &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t__const__, stack,
34544 : &result, obj);
34545 64 : if (unlikely(retcode == -1))
34546 0 : goto __pyx_fail;
34547 64 : return result;
34548 0 : __pyx_fail:
34549 0 : result.memview = NULL;
34550 0 : result.data = NULL;
34551 0 : return result;
34552 : }
34553 :
34554 : /* CIntFromPyVerify */
34555 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
34556 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
34557 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
34558 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
34559 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
34560 : {\
34561 : func_type value = func_value;\
34562 : if (sizeof(target_type) < sizeof(func_type)) {\
34563 : if (unlikely(value != (func_type) (target_type) value)) {\
34564 : func_type zero = 0;\
34565 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
34566 : return (target_type) -1;\
34567 : if (is_unsigned && unlikely(value < zero))\
34568 : goto raise_neg_overflow;\
34569 : else\
34570 : goto raise_overflow;\
34571 : }\
34572 : }\
34573 : return (target_type) value;\
34574 : }
34575 :
34576 : /* ObjectToMemviewSlice */
34577 250 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(PyObject *obj, int writable_flag) {
34578 250 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34579 250 : __Pyx_BufFmt_StackElem stack[1];
34580 250 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34581 250 : int retcode;
34582 250 : if (obj == Py_None) {
34583 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34584 0 : return result;
34585 : }
34586 250 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34587 : PyBUF_RECORDS_RO | writable_flag, 1,
34588 : &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t, stack,
34589 : &result, obj);
34590 250 : if (unlikely(retcode == -1))
34591 0 : goto __pyx_fail;
34592 250 : return result;
34593 0 : __pyx_fail:
34594 0 : result.memview = NULL;
34595 0 : result.data = NULL;
34596 0 : return result;
34597 : }
34598 :
34599 : /* MemviewDtypeToObject */
34600 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(const char *itemp) {
34601 0 : return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) itemp);
34602 : }
34603 0 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(const char *itemp, PyObject *obj) {
34604 0 : __pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t value = __Pyx_PyInt_As_npy_int32(obj);
34605 0 : if (unlikely((value == ((npy_int32)-1)) && PyErr_Occurred()))
34606 : return 0;
34607 0 : *(__pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t *) itemp = value;
34608 0 : return 1;
34609 : }
34610 :
34611 : /* ObjectToMemviewSlice */
34612 8 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t(PyObject *obj, int writable_flag) {
34613 8 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
34614 8 : __Pyx_BufFmt_StackElem stack[1];
34615 8 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
34616 8 : int retcode;
34617 8 : if (obj == Py_None) {
34618 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
34619 0 : return result;
34620 : }
34621 8 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
34622 : PyBUF_RECORDS_RO | writable_flag, 2,
34623 : &__Pyx_TypeInfo_nn___pyx_t_5scipy_6sparse_7csgraph_5_flow_ITYPE_t, stack,
34624 : &result, obj);
34625 8 : if (unlikely(retcode == -1))
34626 0 : goto __pyx_fail;
34627 8 : return result;
34628 0 : __pyx_fail:
34629 0 : result.memview = NULL;
34630 0 : result.data = NULL;
34631 0 : return result;
34632 : }
34633 :
34634 : /* Declarations */
34635 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34636 : #ifdef __cplusplus
34637 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34638 : return ::std::complex< float >(x, y);
34639 : }
34640 : #else
34641 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34642 : return x + y*(__pyx_t_float_complex)_Complex_I;
34643 : }
34644 : #endif
34645 : #else
34646 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
34647 : __pyx_t_float_complex z;
34648 : z.real = x;
34649 : z.imag = y;
34650 : return z;
34651 : }
34652 : #endif
34653 :
34654 : /* Arithmetic */
34655 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34656 : #else
34657 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34658 : return (a.real == b.real) && (a.imag == b.imag);
34659 : }
34660 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34661 : __pyx_t_float_complex z;
34662 : z.real = a.real + b.real;
34663 : z.imag = a.imag + b.imag;
34664 : return z;
34665 : }
34666 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34667 : __pyx_t_float_complex z;
34668 : z.real = a.real - b.real;
34669 : z.imag = a.imag - b.imag;
34670 : return z;
34671 : }
34672 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34673 : __pyx_t_float_complex z;
34674 : z.real = a.real * b.real - a.imag * b.imag;
34675 : z.imag = a.real * b.imag + a.imag * b.real;
34676 : return z;
34677 : }
34678 : #if 1
34679 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34680 : if (b.imag == 0) {
34681 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
34682 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
34683 : if (b.real == 0 && b.imag == 0) {
34684 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
34685 : } else {
34686 : float r = b.imag / b.real;
34687 : float s = (float)(1.0) / (b.real + b.imag * r);
34688 : return __pyx_t_float_complex_from_parts(
34689 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34690 : }
34691 : } else {
34692 : float r = b.real / b.imag;
34693 : float s = (float)(1.0) / (b.imag + b.real * r);
34694 : return __pyx_t_float_complex_from_parts(
34695 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34696 : }
34697 : }
34698 : #else
34699 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34700 : if (b.imag == 0) {
34701 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
34702 : } else {
34703 : float denom = b.real * b.real + b.imag * b.imag;
34704 : return __pyx_t_float_complex_from_parts(
34705 : (a.real * b.real + a.imag * b.imag) / denom,
34706 : (a.imag * b.real - a.real * b.imag) / denom);
34707 : }
34708 : }
34709 : #endif
34710 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
34711 : __pyx_t_float_complex z;
34712 : z.real = -a.real;
34713 : z.imag = -a.imag;
34714 : return z;
34715 : }
34716 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
34717 : return (a.real == 0) && (a.imag == 0);
34718 : }
34719 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
34720 : __pyx_t_float_complex z;
34721 : z.real = a.real;
34722 : z.imag = -a.imag;
34723 : return z;
34724 : }
34725 : #if 1
34726 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
34727 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34728 : return sqrtf(z.real*z.real + z.imag*z.imag);
34729 : #else
34730 : return hypotf(z.real, z.imag);
34731 : #endif
34732 : }
34733 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
34734 : __pyx_t_float_complex z;
34735 : float r, lnr, theta, z_r, z_theta;
34736 : if (b.imag == 0 && b.real == (int)b.real) {
34737 : if (b.real < 0) {
34738 : float denom = a.real * a.real + a.imag * a.imag;
34739 : a.real = a.real / denom;
34740 : a.imag = -a.imag / denom;
34741 : b.real = -b.real;
34742 : }
34743 : switch ((int)b.real) {
34744 : case 0:
34745 : z.real = 1;
34746 : z.imag = 0;
34747 : return z;
34748 : case 1:
34749 : return a;
34750 : case 2:
34751 : return __Pyx_c_prod_float(a, a);
34752 : case 3:
34753 : z = __Pyx_c_prod_float(a, a);
34754 : return __Pyx_c_prod_float(z, a);
34755 : case 4:
34756 : z = __Pyx_c_prod_float(a, a);
34757 : return __Pyx_c_prod_float(z, z);
34758 : }
34759 : }
34760 : if (a.imag == 0) {
34761 : if (a.real == 0) {
34762 : return a;
34763 : } else if ((b.imag == 0) && (a.real >= 0)) {
34764 : z.real = powf(a.real, b.real);
34765 : z.imag = 0;
34766 : return z;
34767 : } else if (a.real > 0) {
34768 : r = a.real;
34769 : theta = 0;
34770 : } else {
34771 : r = -a.real;
34772 : theta = atan2f(0.0, -1.0);
34773 : }
34774 : } else {
34775 : r = __Pyx_c_abs_float(a);
34776 : theta = atan2f(a.imag, a.real);
34777 : }
34778 : lnr = logf(r);
34779 : z_r = expf(lnr * b.real - theta * b.imag);
34780 : z_theta = theta * b.real + lnr * b.imag;
34781 : z.real = z_r * cosf(z_theta);
34782 : z.imag = z_r * sinf(z_theta);
34783 : return z;
34784 : }
34785 : #endif
34786 : #endif
34787 :
34788 : /* Declarations */
34789 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34790 : #ifdef __cplusplus
34791 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34792 : return ::std::complex< double >(x, y);
34793 : }
34794 : #else
34795 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34796 : return x + y*(__pyx_t_double_complex)_Complex_I;
34797 : }
34798 : #endif
34799 : #else
34800 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
34801 : __pyx_t_double_complex z;
34802 : z.real = x;
34803 : z.imag = y;
34804 : return z;
34805 : }
34806 : #endif
34807 :
34808 : /* Arithmetic */
34809 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34810 : #else
34811 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34812 : return (a.real == b.real) && (a.imag == b.imag);
34813 : }
34814 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34815 : __pyx_t_double_complex z;
34816 : z.real = a.real + b.real;
34817 : z.imag = a.imag + b.imag;
34818 : return z;
34819 : }
34820 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34821 : __pyx_t_double_complex z;
34822 : z.real = a.real - b.real;
34823 : z.imag = a.imag - b.imag;
34824 : return z;
34825 : }
34826 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34827 : __pyx_t_double_complex z;
34828 : z.real = a.real * b.real - a.imag * b.imag;
34829 : z.imag = a.real * b.imag + a.imag * b.real;
34830 : return z;
34831 : }
34832 : #if 1
34833 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34834 : if (b.imag == 0) {
34835 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34836 : } else if (fabs(b.real) >= fabs(b.imag)) {
34837 : if (b.real == 0 && b.imag == 0) {
34838 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34839 : } else {
34840 : double r = b.imag / b.real;
34841 : double s = (double)(1.0) / (b.real + b.imag * r);
34842 : return __pyx_t_double_complex_from_parts(
34843 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34844 : }
34845 : } else {
34846 : double r = b.real / b.imag;
34847 : double s = (double)(1.0) / (b.imag + b.real * r);
34848 : return __pyx_t_double_complex_from_parts(
34849 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
34850 : }
34851 : }
34852 : #else
34853 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34854 : if (b.imag == 0) {
34855 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34856 : } else {
34857 : double denom = b.real * b.real + b.imag * b.imag;
34858 : return __pyx_t_double_complex_from_parts(
34859 : (a.real * b.real + a.imag * b.imag) / denom,
34860 : (a.imag * b.real - a.real * b.imag) / denom);
34861 : }
34862 : }
34863 : #endif
34864 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
34865 : __pyx_t_double_complex z;
34866 : z.real = -a.real;
34867 : z.imag = -a.imag;
34868 : return z;
34869 : }
34870 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
34871 : return (a.real == 0) && (a.imag == 0);
34872 : }
34873 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
34874 : __pyx_t_double_complex z;
34875 : z.real = a.real;
34876 : z.imag = -a.imag;
34877 : return z;
34878 : }
34879 : #if 1
34880 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
34881 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
34882 : return sqrt(z.real*z.real + z.imag*z.imag);
34883 : #else
34884 : return hypot(z.real, z.imag);
34885 : #endif
34886 : }
34887 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
34888 : __pyx_t_double_complex z;
34889 : double r, lnr, theta, z_r, z_theta;
34890 : if (b.imag == 0 && b.real == (int)b.real) {
34891 : if (b.real < 0) {
34892 : double denom = a.real * a.real + a.imag * a.imag;
34893 : a.real = a.real / denom;
34894 : a.imag = -a.imag / denom;
34895 : b.real = -b.real;
34896 : }
34897 : switch ((int)b.real) {
34898 : case 0:
34899 : z.real = 1;
34900 : z.imag = 0;
34901 : return z;
34902 : case 1:
34903 : return a;
34904 : case 2:
34905 : return __Pyx_c_prod_double(a, a);
34906 : case 3:
34907 : z = __Pyx_c_prod_double(a, a);
34908 : return __Pyx_c_prod_double(z, a);
34909 : case 4:
34910 : z = __Pyx_c_prod_double(a, a);
34911 : return __Pyx_c_prod_double(z, z);
34912 : }
34913 : }
34914 : if (a.imag == 0) {
34915 : if (a.real == 0) {
34916 : return a;
34917 : } else if ((b.imag == 0) && (a.real >= 0)) {
34918 : z.real = pow(a.real, b.real);
34919 : z.imag = 0;
34920 : return z;
34921 : } else if (a.real > 0) {
34922 : r = a.real;
34923 : theta = 0;
34924 : } else {
34925 : r = -a.real;
34926 : theta = atan2(0.0, -1.0);
34927 : }
34928 : } else {
34929 : r = __Pyx_c_abs_double(a);
34930 : theta = atan2(a.imag, a.real);
34931 : }
34932 : lnr = log(r);
34933 : z_r = exp(lnr * b.real - theta * b.imag);
34934 : z_theta = theta * b.real + lnr * b.imag;
34935 : z.real = z_r * cos(z_theta);
34936 : z.imag = z_r * sin(z_theta);
34937 : return z;
34938 : }
34939 : #endif
34940 : #endif
34941 :
34942 : /* Declarations */
34943 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34944 : #ifdef __cplusplus
34945 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34946 : return ::std::complex< long double >(x, y);
34947 : }
34948 : #else
34949 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34950 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
34951 : }
34952 : #endif
34953 : #else
34954 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
34955 : __pyx_t_long_double_complex z;
34956 : z.real = x;
34957 : z.imag = y;
34958 : return z;
34959 : }
34960 : #endif
34961 :
34962 : /* Arithmetic */
34963 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
34964 : #else
34965 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34966 : return (a.real == b.real) && (a.imag == b.imag);
34967 : }
34968 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34969 : __pyx_t_long_double_complex z;
34970 : z.real = a.real + b.real;
34971 : z.imag = a.imag + b.imag;
34972 : return z;
34973 : }
34974 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34975 : __pyx_t_long_double_complex z;
34976 : z.real = a.real - b.real;
34977 : z.imag = a.imag - b.imag;
34978 : return z;
34979 : }
34980 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34981 : __pyx_t_long_double_complex z;
34982 : z.real = a.real * b.real - a.imag * b.imag;
34983 : z.imag = a.real * b.imag + a.imag * b.real;
34984 : return z;
34985 : }
34986 : #if 1
34987 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
34988 : if (b.imag == 0) {
34989 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
34990 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
34991 : if (b.real == 0 && b.imag == 0) {
34992 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
34993 : } else {
34994 : long double r = b.imag / b.real;
34995 : long double s = (long double)(1.0) / (b.real + b.imag * r);
34996 : return __pyx_t_long_double_complex_from_parts(
34997 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
34998 : }
34999 : } else {
35000 : long double r = b.real / b.imag;
35001 : long double s = (long double)(1.0) / (b.imag + b.real * r);
35002 : return __pyx_t_long_double_complex_from_parts(
35003 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
35004 : }
35005 : }
35006 : #else
35007 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
35008 : if (b.imag == 0) {
35009 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
35010 : } else {
35011 : long double denom = b.real * b.real + b.imag * b.imag;
35012 : return __pyx_t_long_double_complex_from_parts(
35013 : (a.real * b.real + a.imag * b.imag) / denom,
35014 : (a.imag * b.real - a.real * b.imag) / denom);
35015 : }
35016 : }
35017 : #endif
35018 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
35019 : __pyx_t_long_double_complex z;
35020 : z.real = -a.real;
35021 : z.imag = -a.imag;
35022 : return z;
35023 : }
35024 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
35025 : return (a.real == 0) && (a.imag == 0);
35026 : }
35027 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
35028 : __pyx_t_long_double_complex z;
35029 : z.real = a.real;
35030 : z.imag = -a.imag;
35031 : return z;
35032 : }
35033 : #if 1
35034 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
35035 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
35036 : return sqrtl(z.real*z.real + z.imag*z.imag);
35037 : #else
35038 : return hypotl(z.real, z.imag);
35039 : #endif
35040 : }
35041 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
35042 : __pyx_t_long_double_complex z;
35043 : long double r, lnr, theta, z_r, z_theta;
35044 : if (b.imag == 0 && b.real == (int)b.real) {
35045 : if (b.real < 0) {
35046 : long double denom = a.real * a.real + a.imag * a.imag;
35047 : a.real = a.real / denom;
35048 : a.imag = -a.imag / denom;
35049 : b.real = -b.real;
35050 : }
35051 : switch ((int)b.real) {
35052 : case 0:
35053 : z.real = 1;
35054 : z.imag = 0;
35055 : return z;
35056 : case 1:
35057 : return a;
35058 : case 2:
35059 : return __Pyx_c_prod_long__double(a, a);
35060 : case 3:
35061 : z = __Pyx_c_prod_long__double(a, a);
35062 : return __Pyx_c_prod_long__double(z, a);
35063 : case 4:
35064 : z = __Pyx_c_prod_long__double(a, a);
35065 : return __Pyx_c_prod_long__double(z, z);
35066 : }
35067 : }
35068 : if (a.imag == 0) {
35069 : if (a.real == 0) {
35070 : return a;
35071 : } else if ((b.imag == 0) && (a.real >= 0)) {
35072 : z.real = powl(a.real, b.real);
35073 : z.imag = 0;
35074 : return z;
35075 : } else if (a.real > 0) {
35076 : r = a.real;
35077 : theta = 0;
35078 : } else {
35079 : r = -a.real;
35080 : theta = atan2l(0.0, -1.0);
35081 : }
35082 : } else {
35083 : r = __Pyx_c_abs_long__double(a);
35084 : theta = atan2l(a.imag, a.real);
35085 : }
35086 : lnr = logl(r);
35087 : z_r = expl(lnr * b.real - theta * b.imag);
35088 : z_theta = theta * b.real + lnr * b.imag;
35089 : z.real = z_r * cosl(z_theta);
35090 : z.imag = z_r * sinl(z_theta);
35091 : return z;
35092 : }
35093 : #endif
35094 : #endif
35095 :
35096 : /* MemviewSliceCopyTemplate */
35097 : static __Pyx_memviewslice
35098 0 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
35099 : const char *mode, int ndim,
35100 : size_t sizeof_dtype, int contig_flag,
35101 : int dtype_is_object)
35102 : {
35103 : __Pyx_RefNannyDeclarations
35104 0 : int i;
35105 0 : __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
35106 0 : struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
35107 0 : Py_buffer *buf = &from_memview->view;
35108 0 : PyObject *shape_tuple = NULL;
35109 0 : PyObject *temp_int = NULL;
35110 0 : struct __pyx_array_obj *array_obj = NULL;
35111 0 : struct __pyx_memoryview_obj *memview_obj = NULL;
35112 0 : __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
35113 0 : for (i = 0; i < ndim; i++) {
35114 0 : if (unlikely(from_mvs->suboffsets[i] >= 0)) {
35115 0 : PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
35116 : "indirect dimensions (axis %d)", i);
35117 0 : goto fail;
35118 : }
35119 : }
35120 0 : shape_tuple = PyTuple_New(ndim);
35121 0 : if (unlikely(!shape_tuple)) {
35122 0 : goto fail;
35123 : }
35124 : __Pyx_GOTREF(shape_tuple);
35125 0 : for(i = 0; i < ndim; i++) {
35126 0 : temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
35127 0 : if(unlikely(!temp_int)) {
35128 0 : goto fail;
35129 : } else {
35130 0 : PyTuple_SET_ITEM(shape_tuple, i, temp_int);
35131 0 : temp_int = NULL;
35132 : }
35133 : }
35134 0 : array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
35135 0 : if (unlikely(!array_obj)) {
35136 0 : goto fail;
35137 : }
35138 0 : __Pyx_GOTREF(array_obj);
35139 0 : memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
35140 : (PyObject *) array_obj, contig_flag,
35141 : dtype_is_object,
35142 0 : from_mvs->memview->typeinfo);
35143 0 : if (unlikely(!memview_obj))
35144 0 : goto fail;
35145 0 : if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
35146 0 : goto fail;
35147 0 : if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
35148 : dtype_is_object) < 0))
35149 0 : goto fail;
35150 0 : goto no_fail;
35151 0 : fail:
35152 0 : __Pyx_XDECREF(new_mvs.memview);
35153 0 : new_mvs.memview = NULL;
35154 0 : new_mvs.data = NULL;
35155 0 : no_fail:
35156 0 : __Pyx_XDECREF(shape_tuple);
35157 0 : __Pyx_XDECREF(temp_int);
35158 0 : __Pyx_XDECREF(array_obj);
35159 0 : __Pyx_RefNannyFinishContext();
35160 0 : return new_mvs;
35161 : }
35162 :
35163 : /* MemviewSliceInit */
35164 : static int
35165 322 : __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
35166 : int ndim,
35167 : __Pyx_memviewslice *memviewslice,
35168 : int memview_is_new_reference)
35169 : {
35170 : __Pyx_RefNannyDeclarations
35171 322 : int i, retval=-1;
35172 322 : Py_buffer *buf = &memview->view;
35173 322 : __Pyx_RefNannySetupContext("init_memviewslice", 0);
35174 322 : if (unlikely(memviewslice->memview || memviewslice->data)) {
35175 0 : PyErr_SetString(PyExc_ValueError,
35176 : "memviewslice is already initialized!");
35177 0 : goto fail;
35178 : }
35179 322 : if (buf->strides) {
35180 652 : for (i = 0; i < ndim; i++) {
35181 330 : memviewslice->strides[i] = buf->strides[i];
35182 : }
35183 : } else {
35184 0 : Py_ssize_t stride = buf->itemsize;
35185 0 : for (i = ndim - 1; i >= 0; i--) {
35186 0 : memviewslice->strides[i] = stride;
35187 0 : stride *= buf->shape[i];
35188 : }
35189 : }
35190 652 : for (i = 0; i < ndim; i++) {
35191 330 : memviewslice->shape[i] = buf->shape[i];
35192 330 : if (buf->suboffsets) {
35193 0 : memviewslice->suboffsets[i] = buf->suboffsets[i];
35194 : } else {
35195 330 : memviewslice->suboffsets[i] = -1;
35196 : }
35197 : }
35198 322 : memviewslice->memview = memview;
35199 322 : memviewslice->data = (char *)buf->buf;
35200 322 : if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
35201 8 : Py_INCREF(memview);
35202 : }
35203 322 : retval = 0;
35204 322 : goto no_fail;
35205 0 : fail:
35206 0 : memviewslice->memview = 0;
35207 0 : memviewslice->data = 0;
35208 0 : retval = -1;
35209 322 : no_fail:
35210 322 : __Pyx_RefNannyFinishContext();
35211 322 : return retval;
35212 : }
35213 : #ifndef Py_NO_RETURN
35214 : #define Py_NO_RETURN
35215 : #endif
35216 0 : static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
35217 0 : va_list vargs;
35218 0 : char msg[200];
35219 : #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
35220 0 : va_start(vargs, fmt);
35221 : #else
35222 : va_start(vargs);
35223 : #endif
35224 0 : vsnprintf(msg, 200, fmt, vargs);
35225 0 : va_end(vargs);
35226 0 : Py_FatalError(msg);
35227 : }
35228 : static CYTHON_INLINE int
35229 : __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35230 : PyThread_type_lock lock)
35231 : {
35232 : int result;
35233 : PyThread_acquire_lock(lock, 1);
35234 : result = (*acquisition_count)++;
35235 : PyThread_release_lock(lock);
35236 : return result;
35237 : }
35238 : static CYTHON_INLINE int
35239 : __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
35240 : PyThread_type_lock lock)
35241 : {
35242 : int result;
35243 : PyThread_acquire_lock(lock, 1);
35244 : result = (*acquisition_count)--;
35245 : PyThread_release_lock(lock);
35246 : return result;
35247 : }
35248 : static CYTHON_INLINE void
35249 45 : __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
35250 : {
35251 45 : __pyx_nonatomic_int_type old_acquisition_count;
35252 45 : struct __pyx_memoryview_obj *memview = memslice->memview;
35253 45 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35254 : return;
35255 : }
35256 45 : old_acquisition_count = __pyx_add_acquisition_count(memview);
35257 45 : if (unlikely(old_acquisition_count <= 0)) {
35258 0 : if (likely(old_acquisition_count == 0)) {
35259 0 : if (have_gil) {
35260 0 : Py_INCREF((PyObject *) memview);
35261 : } else {
35262 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
35263 0 : Py_INCREF((PyObject *) memview);
35264 0 : PyGILState_Release(_gilstate);
35265 : }
35266 : } else {
35267 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
35268 : old_acquisition_count+1, lineno);
35269 : }
35270 : }
35271 : }
35272 554 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
35273 : int have_gil, int lineno) {
35274 554 : __pyx_nonatomic_int_type old_acquisition_count;
35275 554 : struct __pyx_memoryview_obj *memview = memslice->memview;
35276 554 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
35277 187 : memslice->memview = NULL;
35278 187 : return;
35279 : }
35280 367 : old_acquisition_count = __pyx_sub_acquisition_count(memview);
35281 367 : memslice->data = NULL;
35282 367 : if (likely(old_acquisition_count > 1)) {
35283 45 : memslice->memview = NULL;
35284 322 : } else if (likely(old_acquisition_count == 1)) {
35285 322 : if (have_gil) {
35286 322 : Py_CLEAR(memslice->memview);
35287 : } else {
35288 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
35289 0 : Py_CLEAR(memslice->memview);
35290 0 : PyGILState_Release(_gilstate);
35291 : }
35292 : } else {
35293 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
35294 : old_acquisition_count-1, lineno);
35295 : }
35296 : }
35297 :
35298 : /* CIntToPy */
35299 20 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
35300 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35301 : #pragma GCC diagnostic push
35302 : #pragma GCC diagnostic ignored "-Wconversion"
35303 : #endif
35304 20 : const long neg_one = (long) -1, const_zero = (long) 0;
35305 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35306 : #pragma GCC diagnostic pop
35307 : #endif
35308 20 : const int is_unsigned = neg_one > const_zero;
35309 20 : if (is_unsigned) {
35310 : if (sizeof(long) < sizeof(long)) {
35311 : return PyInt_FromLong((long) value);
35312 : } else if (sizeof(long) <= sizeof(unsigned long)) {
35313 : return PyLong_FromUnsignedLong((unsigned long) value);
35314 : #ifdef HAVE_LONG_LONG
35315 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
35316 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35317 : #endif
35318 : }
35319 : } else {
35320 20 : if (sizeof(long) <= sizeof(long)) {
35321 20 : return PyInt_FromLong((long) value);
35322 : #ifdef HAVE_LONG_LONG
35323 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
35324 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35325 : #endif
35326 : }
35327 : }
35328 : {
35329 : unsigned char *bytes = (unsigned char *)&value;
35330 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35331 : if (is_unsigned) {
35332 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35333 : } else {
35334 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35335 : }
35336 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35337 : int one = 1; int little = (int)*(unsigned char *)&one;
35338 : return _PyLong_FromByteArray(bytes, sizeof(long),
35339 : little, !is_unsigned);
35340 : #else
35341 : int one = 1; int little = (int)*(unsigned char *)&one;
35342 : PyObject *from_bytes, *result = NULL;
35343 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35344 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35345 : if (!from_bytes) return NULL;
35346 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
35347 : if (!py_bytes) goto limited_bad;
35348 : order_str = PyUnicode_FromString(little ? "little" : "big");
35349 : if (!order_str) goto limited_bad;
35350 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35351 : if (!arg_tuple) goto limited_bad;
35352 : if (!is_unsigned) {
35353 : kwds = PyDict_New();
35354 : if (!kwds) goto limited_bad;
35355 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35356 : }
35357 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35358 : limited_bad:
35359 : Py_XDECREF(kwds);
35360 : Py_XDECREF(arg_tuple);
35361 : Py_XDECREF(order_str);
35362 : Py_XDECREF(py_bytes);
35363 : Py_XDECREF(from_bytes);
35364 : return result;
35365 : #endif
35366 : }
35367 : }
35368 :
35369 : /* CIntFromPy */
35370 60 : static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
35371 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35372 : #pragma GCC diagnostic push
35373 : #pragma GCC diagnostic ignored "-Wconversion"
35374 : #endif
35375 60 : const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
35376 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35377 : #pragma GCC diagnostic pop
35378 : #endif
35379 60 : const int is_unsigned = neg_one > const_zero;
35380 : #if PY_MAJOR_VERSION < 3
35381 : if (likely(PyInt_Check(x))) {
35382 : if ((sizeof(npy_int32) < sizeof(long))) {
35383 : __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
35384 : } else {
35385 : long val = PyInt_AS_LONG(x);
35386 : if (is_unsigned && unlikely(val < 0)) {
35387 : goto raise_neg_overflow;
35388 : }
35389 : return (npy_int32) val;
35390 : }
35391 : }
35392 : #endif
35393 60 : if (unlikely(!PyLong_Check(x))) {
35394 0 : npy_int32 val;
35395 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35396 0 : if (!tmp) return (npy_int32) -1;
35397 0 : val = __Pyx_PyInt_As_npy_int32(tmp);
35398 0 : Py_DECREF(tmp);
35399 0 : return val;
35400 : }
35401 60 : if (is_unsigned) {
35402 : #if CYTHON_USE_PYLONG_INTERNALS
35403 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35404 : goto raise_neg_overflow;
35405 : } else if (__Pyx_PyLong_IsCompact(x)) {
35406 : __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35407 : } else {
35408 : const digit* digits = __Pyx_PyLong_Digits(x);
35409 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35410 : switch (__Pyx_PyLong_DigitCount(x)) {
35411 : case 2:
35412 : if ((8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
35413 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35414 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35415 : } else if ((8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT)) {
35416 : return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
35417 : }
35418 : }
35419 : break;
35420 : case 3:
35421 : if ((8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
35422 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35423 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35424 : } else if ((8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT)) {
35425 : return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
35426 : }
35427 : }
35428 : break;
35429 : case 4:
35430 : if ((8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
35431 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35432 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35433 : } else if ((8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT)) {
35434 : return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
35435 : }
35436 : }
35437 : break;
35438 : }
35439 : }
35440 : #endif
35441 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35442 : if (unlikely(Py_SIZE(x) < 0)) {
35443 : goto raise_neg_overflow;
35444 : }
35445 : #else
35446 : {
35447 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35448 : if (unlikely(result < 0))
35449 : return (npy_int32) -1;
35450 : if (unlikely(result == 1))
35451 : goto raise_neg_overflow;
35452 : }
35453 : #endif
35454 : if ((sizeof(npy_int32) <= sizeof(unsigned long))) {
35455 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
35456 : #ifdef HAVE_LONG_LONG
35457 : } else if ((sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG))) {
35458 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35459 : #endif
35460 : }
35461 : } else {
35462 : #if CYTHON_USE_PYLONG_INTERNALS
35463 60 : if (__Pyx_PyLong_IsCompact(x)) {
35464 52 : __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35465 : } else {
35466 8 : const digit* digits = __Pyx_PyLong_Digits(x);
35467 8 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35468 8 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35469 : case -2:
35470 0 : if ((8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT)) {
35471 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35472 0 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35473 : } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
35474 : return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35475 : }
35476 : }
35477 : break;
35478 : case 2:
35479 8 : if ((8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
35480 8 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35481 8 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35482 : } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
35483 : return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35484 : }
35485 : }
35486 : break;
35487 : case -3:
35488 : if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
35489 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35490 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35491 : } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
35492 : return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35493 : }
35494 : }
35495 : break;
35496 : case 3:
35497 : if ((8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
35498 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35499 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35500 : } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
35501 : return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35502 : }
35503 : }
35504 : break;
35505 : case -4:
35506 : if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
35507 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35508 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35509 : } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
35510 : return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35511 : }
35512 : }
35513 : break;
35514 : case 4:
35515 : if ((8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
35516 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35517 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35518 : } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
35519 : return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
35520 : }
35521 : }
35522 : break;
35523 : }
35524 : }
35525 : #endif
35526 0 : if ((sizeof(npy_int32) <= sizeof(long))) {
35527 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
35528 : #ifdef HAVE_LONG_LONG
35529 : } else if ((sizeof(npy_int32) <= sizeof(PY_LONG_LONG))) {
35530 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
35531 : #endif
35532 : }
35533 : }
35534 : {
35535 : npy_int32 val;
35536 : int ret = -1;
35537 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35538 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35539 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35540 : if (unlikely(bytes_copied == -1)) {
35541 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35542 : goto raise_overflow;
35543 : } else {
35544 : ret = 0;
35545 : }
35546 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35547 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35548 : unsigned char *bytes = (unsigned char *)&val;
35549 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35550 : bytes, sizeof(val),
35551 : is_little, !is_unsigned);
35552 : #else
35553 : PyObject *v;
35554 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35555 : int bits, remaining_bits, is_negative = 0;
35556 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35557 : if (likely(PyLong_CheckExact(x))) {
35558 : v = __Pyx_NewRef(x);
35559 : } else {
35560 : v = PyNumber_Long(x);
35561 : if (unlikely(!v)) return (npy_int32) -1;
35562 : assert(PyLong_CheckExact(v));
35563 : }
35564 : {
35565 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35566 : if (unlikely(result < 0)) {
35567 : Py_DECREF(v);
35568 : return (npy_int32) -1;
35569 : }
35570 : is_negative = result == 1;
35571 : }
35572 : if (is_unsigned && unlikely(is_negative)) {
35573 : Py_DECREF(v);
35574 : goto raise_neg_overflow;
35575 : } else if (is_negative) {
35576 : stepval = PyNumber_Invert(v);
35577 : Py_DECREF(v);
35578 : if (unlikely(!stepval))
35579 : return (npy_int32) -1;
35580 : } else {
35581 : stepval = v;
35582 : }
35583 : v = NULL;
35584 : val = (npy_int32) 0;
35585 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35586 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35587 : for (bits = 0; bits < (int) sizeof(npy_int32) * 8 - chunk_size; bits += chunk_size) {
35588 : PyObject *tmp, *digit;
35589 : long idigit;
35590 : digit = PyNumber_And(stepval, mask);
35591 : if (unlikely(!digit)) goto done;
35592 : idigit = PyLong_AsLong(digit);
35593 : Py_DECREF(digit);
35594 : if (unlikely(idigit < 0)) goto done;
35595 : val |= ((npy_int32) idigit) << bits;
35596 : tmp = PyNumber_Rshift(stepval, shift);
35597 : if (unlikely(!tmp)) goto done;
35598 : Py_DECREF(stepval); stepval = tmp;
35599 : }
35600 : Py_DECREF(shift); shift = NULL;
35601 : Py_DECREF(mask); mask = NULL;
35602 : {
35603 : long idigit = PyLong_AsLong(stepval);
35604 : if (unlikely(idigit < 0)) goto done;
35605 : remaining_bits = ((int) sizeof(npy_int32) * 8) - bits - (is_unsigned ? 0 : 1);
35606 : if (unlikely(idigit >= (1L << remaining_bits)))
35607 : goto raise_overflow;
35608 : val |= ((npy_int32) idigit) << bits;
35609 : }
35610 : if (!is_unsigned) {
35611 : if (unlikely(val & (((npy_int32) 1) << (sizeof(npy_int32) * 8 - 1))))
35612 : goto raise_overflow;
35613 : if (is_negative)
35614 : val = ~val;
35615 : }
35616 : ret = 0;
35617 : done:
35618 : Py_XDECREF(shift);
35619 : Py_XDECREF(mask);
35620 : Py_XDECREF(stepval);
35621 : #endif
35622 : if (unlikely(ret))
35623 : return (npy_int32) -1;
35624 : return val;
35625 : }
35626 0 : raise_overflow:
35627 0 : PyErr_SetString(PyExc_OverflowError,
35628 : "value too large to convert to npy_int32");
35629 0 : return (npy_int32) -1;
35630 : raise_neg_overflow:
35631 : PyErr_SetString(PyExc_OverflowError,
35632 : "can't convert negative value to npy_int32");
35633 : return (npy_int32) -1;
35634 : }
35635 :
35636 : /* CIntToPy */
35637 104 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
35638 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35639 : #pragma GCC diagnostic push
35640 : #pragma GCC diagnostic ignored "-Wconversion"
35641 : #endif
35642 104 : const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
35643 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35644 : #pragma GCC diagnostic pop
35645 : #endif
35646 104 : const int is_unsigned = neg_one > const_zero;
35647 104 : if (is_unsigned) {
35648 : if (sizeof(npy_int32) < sizeof(long)) {
35649 : return PyInt_FromLong((long) value);
35650 : } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
35651 : return PyLong_FromUnsignedLong((unsigned long) value);
35652 : #ifdef HAVE_LONG_LONG
35653 : } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
35654 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35655 : #endif
35656 : }
35657 : } else {
35658 104 : if (sizeof(npy_int32) <= sizeof(long)) {
35659 104 : return PyInt_FromLong((long) value);
35660 : #ifdef HAVE_LONG_LONG
35661 : } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
35662 : return PyLong_FromLongLong((PY_LONG_LONG) value);
35663 : #endif
35664 : }
35665 : }
35666 : {
35667 : unsigned char *bytes = (unsigned char *)&value;
35668 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
35669 : if (is_unsigned) {
35670 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
35671 : } else {
35672 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
35673 : }
35674 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
35675 : int one = 1; int little = (int)*(unsigned char *)&one;
35676 : return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
35677 : little, !is_unsigned);
35678 : #else
35679 : int one = 1; int little = (int)*(unsigned char *)&one;
35680 : PyObject *from_bytes, *result = NULL;
35681 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
35682 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
35683 : if (!from_bytes) return NULL;
35684 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int32));
35685 : if (!py_bytes) goto limited_bad;
35686 : order_str = PyUnicode_FromString(little ? "little" : "big");
35687 : if (!order_str) goto limited_bad;
35688 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
35689 : if (!arg_tuple) goto limited_bad;
35690 : if (!is_unsigned) {
35691 : kwds = PyDict_New();
35692 : if (!kwds) goto limited_bad;
35693 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
35694 : }
35695 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
35696 : limited_bad:
35697 : Py_XDECREF(kwds);
35698 : Py_XDECREF(arg_tuple);
35699 : Py_XDECREF(order_str);
35700 : Py_XDECREF(py_bytes);
35701 : Py_XDECREF(from_bytes);
35702 : return result;
35703 : #endif
35704 : }
35705 : }
35706 :
35707 : /* CIntFromPy */
35708 377 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
35709 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35710 : #pragma GCC diagnostic push
35711 : #pragma GCC diagnostic ignored "-Wconversion"
35712 : #endif
35713 377 : const int neg_one = (int) -1, const_zero = (int) 0;
35714 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35715 : #pragma GCC diagnostic pop
35716 : #endif
35717 377 : const int is_unsigned = neg_one > const_zero;
35718 : #if PY_MAJOR_VERSION < 3
35719 : if (likely(PyInt_Check(x))) {
35720 : if ((sizeof(int) < sizeof(long))) {
35721 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
35722 : } else {
35723 : long val = PyInt_AS_LONG(x);
35724 : if (is_unsigned && unlikely(val < 0)) {
35725 : goto raise_neg_overflow;
35726 : }
35727 : return (int) val;
35728 : }
35729 : }
35730 : #endif
35731 377 : if (unlikely(!PyLong_Check(x))) {
35732 0 : int val;
35733 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35734 0 : if (!tmp) return (int) -1;
35735 0 : val = __Pyx_PyInt_As_int(tmp);
35736 0 : Py_DECREF(tmp);
35737 0 : return val;
35738 : }
35739 377 : if (is_unsigned) {
35740 : #if CYTHON_USE_PYLONG_INTERNALS
35741 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
35742 : goto raise_neg_overflow;
35743 : } else if (__Pyx_PyLong_IsCompact(x)) {
35744 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
35745 : } else {
35746 : const digit* digits = __Pyx_PyLong_Digits(x);
35747 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35748 : switch (__Pyx_PyLong_DigitCount(x)) {
35749 : case 2:
35750 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35751 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35752 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35753 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
35754 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35755 : }
35756 : }
35757 : break;
35758 : case 3:
35759 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35760 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35761 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35762 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
35763 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35764 : }
35765 : }
35766 : break;
35767 : case 4:
35768 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35769 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35770 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35771 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
35772 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35773 : }
35774 : }
35775 : break;
35776 : }
35777 : }
35778 : #endif
35779 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
35780 : if (unlikely(Py_SIZE(x) < 0)) {
35781 : goto raise_neg_overflow;
35782 : }
35783 : #else
35784 : {
35785 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35786 : if (unlikely(result < 0))
35787 : return (int) -1;
35788 : if (unlikely(result == 1))
35789 : goto raise_neg_overflow;
35790 : }
35791 : #endif
35792 : if ((sizeof(int) <= sizeof(unsigned long))) {
35793 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
35794 : #ifdef HAVE_LONG_LONG
35795 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
35796 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35797 : #endif
35798 : }
35799 : } else {
35800 : #if CYTHON_USE_PYLONG_INTERNALS
35801 377 : if (__Pyx_PyLong_IsCompact(x)) {
35802 377 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
35803 : } else {
35804 0 : const digit* digits = __Pyx_PyLong_Digits(x);
35805 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
35806 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
35807 : case -2:
35808 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
35809 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35810 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35811 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35812 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35813 : }
35814 : }
35815 : break;
35816 : case 2:
35817 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
35818 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
35819 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35820 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35821 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35822 : }
35823 : }
35824 : break;
35825 : case -3:
35826 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
35827 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35828 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35829 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35830 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35831 : }
35832 : }
35833 : break;
35834 : case 3:
35835 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
35836 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
35837 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35838 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35839 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35840 : }
35841 : }
35842 : break;
35843 : case -4:
35844 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
35845 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35846 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35847 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35848 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35849 : }
35850 : }
35851 : break;
35852 : case 4:
35853 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
35854 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
35855 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35856 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
35857 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35858 : }
35859 : }
35860 : break;
35861 : }
35862 : }
35863 : #endif
35864 0 : if ((sizeof(int) <= sizeof(long))) {
35865 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
35866 : #ifdef HAVE_LONG_LONG
35867 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
35868 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
35869 : #endif
35870 : }
35871 : }
35872 : {
35873 : int val;
35874 : int ret = -1;
35875 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
35876 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
35877 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
35878 : if (unlikely(bytes_copied == -1)) {
35879 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
35880 : goto raise_overflow;
35881 : } else {
35882 : ret = 0;
35883 : }
35884 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
35885 : int one = 1; int is_little = (int)*(unsigned char *)&one;
35886 : unsigned char *bytes = (unsigned char *)&val;
35887 : ret = _PyLong_AsByteArray((PyLongObject *)x,
35888 : bytes, sizeof(val),
35889 : is_little, !is_unsigned);
35890 : #else
35891 : PyObject *v;
35892 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
35893 : int bits, remaining_bits, is_negative = 0;
35894 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
35895 : if (likely(PyLong_CheckExact(x))) {
35896 : v = __Pyx_NewRef(x);
35897 : } else {
35898 : v = PyNumber_Long(x);
35899 : if (unlikely(!v)) return (int) -1;
35900 : assert(PyLong_CheckExact(v));
35901 : }
35902 : {
35903 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
35904 : if (unlikely(result < 0)) {
35905 : Py_DECREF(v);
35906 : return (int) -1;
35907 : }
35908 : is_negative = result == 1;
35909 : }
35910 : if (is_unsigned && unlikely(is_negative)) {
35911 : Py_DECREF(v);
35912 : goto raise_neg_overflow;
35913 : } else if (is_negative) {
35914 : stepval = PyNumber_Invert(v);
35915 : Py_DECREF(v);
35916 : if (unlikely(!stepval))
35917 : return (int) -1;
35918 : } else {
35919 : stepval = v;
35920 : }
35921 : v = NULL;
35922 : val = (int) 0;
35923 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
35924 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
35925 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
35926 : PyObject *tmp, *digit;
35927 : long idigit;
35928 : digit = PyNumber_And(stepval, mask);
35929 : if (unlikely(!digit)) goto done;
35930 : idigit = PyLong_AsLong(digit);
35931 : Py_DECREF(digit);
35932 : if (unlikely(idigit < 0)) goto done;
35933 : val |= ((int) idigit) << bits;
35934 : tmp = PyNumber_Rshift(stepval, shift);
35935 : if (unlikely(!tmp)) goto done;
35936 : Py_DECREF(stepval); stepval = tmp;
35937 : }
35938 : Py_DECREF(shift); shift = NULL;
35939 : Py_DECREF(mask); mask = NULL;
35940 : {
35941 : long idigit = PyLong_AsLong(stepval);
35942 : if (unlikely(idigit < 0)) goto done;
35943 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
35944 : if (unlikely(idigit >= (1L << remaining_bits)))
35945 : goto raise_overflow;
35946 : val |= ((int) idigit) << bits;
35947 : }
35948 : if (!is_unsigned) {
35949 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
35950 : goto raise_overflow;
35951 : if (is_negative)
35952 : val = ~val;
35953 : }
35954 : ret = 0;
35955 : done:
35956 : Py_XDECREF(shift);
35957 : Py_XDECREF(mask);
35958 : Py_XDECREF(stepval);
35959 : #endif
35960 : if (unlikely(ret))
35961 : return (int) -1;
35962 : return val;
35963 : }
35964 0 : raise_overflow:
35965 0 : PyErr_SetString(PyExc_OverflowError,
35966 : "value too large to convert to int");
35967 0 : return (int) -1;
35968 : raise_neg_overflow:
35969 : PyErr_SetString(PyExc_OverflowError,
35970 : "can't convert negative value to int");
35971 : return (int) -1;
35972 : }
35973 :
35974 : /* CIntToPy */
35975 356 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
35976 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35977 : #pragma GCC diagnostic push
35978 : #pragma GCC diagnostic ignored "-Wconversion"
35979 : #endif
35980 356 : const int neg_one = (int) -1, const_zero = (int) 0;
35981 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
35982 : #pragma GCC diagnostic pop
35983 : #endif
35984 356 : const int is_unsigned = neg_one > const_zero;
35985 356 : if (is_unsigned) {
35986 : if (sizeof(int) < sizeof(long)) {
35987 : return PyInt_FromLong((long) value);
35988 : } else if (sizeof(int) <= sizeof(unsigned long)) {
35989 : return PyLong_FromUnsignedLong((unsigned long) value);
35990 : #ifdef HAVE_LONG_LONG
35991 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
35992 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35993 : #endif
35994 : }
35995 : } else {
35996 356 : if (sizeof(int) <= sizeof(long)) {
35997 356 : return PyInt_FromLong((long) value);
35998 : #ifdef HAVE_LONG_LONG
35999 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
36000 : return PyLong_FromLongLong((PY_LONG_LONG) value);
36001 : #endif
36002 : }
36003 : }
36004 : {
36005 : unsigned char *bytes = (unsigned char *)&value;
36006 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
36007 : if (is_unsigned) {
36008 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
36009 : } else {
36010 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
36011 : }
36012 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
36013 : int one = 1; int little = (int)*(unsigned char *)&one;
36014 : return _PyLong_FromByteArray(bytes, sizeof(int),
36015 : little, !is_unsigned);
36016 : #else
36017 : int one = 1; int little = (int)*(unsigned char *)&one;
36018 : PyObject *from_bytes, *result = NULL;
36019 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
36020 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
36021 : if (!from_bytes) return NULL;
36022 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
36023 : if (!py_bytes) goto limited_bad;
36024 : order_str = PyUnicode_FromString(little ? "little" : "big");
36025 : if (!order_str) goto limited_bad;
36026 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
36027 : if (!arg_tuple) goto limited_bad;
36028 : if (!is_unsigned) {
36029 : kwds = PyDict_New();
36030 : if (!kwds) goto limited_bad;
36031 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
36032 : }
36033 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
36034 : limited_bad:
36035 : Py_XDECREF(kwds);
36036 : Py_XDECREF(arg_tuple);
36037 : Py_XDECREF(order_str);
36038 : Py_XDECREF(py_bytes);
36039 : Py_XDECREF(from_bytes);
36040 : return result;
36041 : #endif
36042 : }
36043 : }
36044 :
36045 : /* CIntFromPy */
36046 0 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
36047 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36048 : #pragma GCC diagnostic push
36049 : #pragma GCC diagnostic ignored "-Wconversion"
36050 : #endif
36051 0 : const long neg_one = (long) -1, const_zero = (long) 0;
36052 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36053 : #pragma GCC diagnostic pop
36054 : #endif
36055 0 : const int is_unsigned = neg_one > const_zero;
36056 : #if PY_MAJOR_VERSION < 3
36057 : if (likely(PyInt_Check(x))) {
36058 : if ((sizeof(long) < sizeof(long))) {
36059 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
36060 : } else {
36061 : long val = PyInt_AS_LONG(x);
36062 : if (is_unsigned && unlikely(val < 0)) {
36063 : goto raise_neg_overflow;
36064 : }
36065 : return (long) val;
36066 : }
36067 : }
36068 : #endif
36069 0 : if (unlikely(!PyLong_Check(x))) {
36070 0 : long val;
36071 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
36072 0 : if (!tmp) return (long) -1;
36073 0 : val = __Pyx_PyInt_As_long(tmp);
36074 0 : Py_DECREF(tmp);
36075 0 : return val;
36076 : }
36077 0 : if (is_unsigned) {
36078 : #if CYTHON_USE_PYLONG_INTERNALS
36079 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
36080 : goto raise_neg_overflow;
36081 : } else if (__Pyx_PyLong_IsCompact(x)) {
36082 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
36083 : } else {
36084 : const digit* digits = __Pyx_PyLong_Digits(x);
36085 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36086 : switch (__Pyx_PyLong_DigitCount(x)) {
36087 : case 2:
36088 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
36089 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36090 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36091 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
36092 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36093 : }
36094 : }
36095 : break;
36096 : case 3:
36097 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36098 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36099 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36100 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
36101 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36102 : }
36103 : }
36104 : break;
36105 : case 4:
36106 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36107 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36108 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36109 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
36110 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
36111 : }
36112 : }
36113 : break;
36114 : }
36115 : }
36116 : #endif
36117 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
36118 : if (unlikely(Py_SIZE(x) < 0)) {
36119 : goto raise_neg_overflow;
36120 : }
36121 : #else
36122 : {
36123 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36124 : if (unlikely(result < 0))
36125 : return (long) -1;
36126 : if (unlikely(result == 1))
36127 : goto raise_neg_overflow;
36128 : }
36129 : #endif
36130 : if ((sizeof(long) <= sizeof(unsigned long))) {
36131 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
36132 : #ifdef HAVE_LONG_LONG
36133 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
36134 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36135 : #endif
36136 : }
36137 : } else {
36138 : #if CYTHON_USE_PYLONG_INTERNALS
36139 0 : if (__Pyx_PyLong_IsCompact(x)) {
36140 0 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
36141 : } else {
36142 0 : const digit* digits = __Pyx_PyLong_Digits(x);
36143 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36144 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
36145 : case -2:
36146 0 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
36147 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36148 0 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36149 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36150 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36151 : }
36152 : }
36153 : break;
36154 : case 2:
36155 0 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
36156 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36157 0 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36158 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36159 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36160 : }
36161 : }
36162 : break;
36163 : case -3:
36164 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
36165 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36166 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36167 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36168 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36169 : }
36170 : }
36171 : break;
36172 : case 3:
36173 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
36174 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36175 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36176 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36177 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36178 : }
36179 : }
36180 : break;
36181 : case -4:
36182 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
36183 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36184 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36185 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
36186 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36187 : }
36188 : }
36189 : break;
36190 : case 4:
36191 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
36192 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36193 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36194 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
36195 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
36196 : }
36197 : }
36198 : break;
36199 : }
36200 : }
36201 : #endif
36202 0 : if ((sizeof(long) <= sizeof(long))) {
36203 0 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
36204 : #ifdef HAVE_LONG_LONG
36205 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
36206 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
36207 : #endif
36208 : }
36209 : }
36210 : {
36211 : long val;
36212 : int ret = -1;
36213 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
36214 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
36215 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
36216 : if (unlikely(bytes_copied == -1)) {
36217 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
36218 : goto raise_overflow;
36219 : } else {
36220 : ret = 0;
36221 : }
36222 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
36223 : int one = 1; int is_little = (int)*(unsigned char *)&one;
36224 : unsigned char *bytes = (unsigned char *)&val;
36225 : ret = _PyLong_AsByteArray((PyLongObject *)x,
36226 : bytes, sizeof(val),
36227 : is_little, !is_unsigned);
36228 : #else
36229 : PyObject *v;
36230 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
36231 : int bits, remaining_bits, is_negative = 0;
36232 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
36233 : if (likely(PyLong_CheckExact(x))) {
36234 : v = __Pyx_NewRef(x);
36235 : } else {
36236 : v = PyNumber_Long(x);
36237 : if (unlikely(!v)) return (long) -1;
36238 : assert(PyLong_CheckExact(v));
36239 : }
36240 : {
36241 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
36242 : if (unlikely(result < 0)) {
36243 : Py_DECREF(v);
36244 : return (long) -1;
36245 : }
36246 : is_negative = result == 1;
36247 : }
36248 : if (is_unsigned && unlikely(is_negative)) {
36249 : Py_DECREF(v);
36250 : goto raise_neg_overflow;
36251 : } else if (is_negative) {
36252 : stepval = PyNumber_Invert(v);
36253 : Py_DECREF(v);
36254 : if (unlikely(!stepval))
36255 : return (long) -1;
36256 : } else {
36257 : stepval = v;
36258 : }
36259 : v = NULL;
36260 : val = (long) 0;
36261 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
36262 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
36263 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
36264 : PyObject *tmp, *digit;
36265 : long idigit;
36266 : digit = PyNumber_And(stepval, mask);
36267 : if (unlikely(!digit)) goto done;
36268 : idigit = PyLong_AsLong(digit);
36269 : Py_DECREF(digit);
36270 : if (unlikely(idigit < 0)) goto done;
36271 : val |= ((long) idigit) << bits;
36272 : tmp = PyNumber_Rshift(stepval, shift);
36273 : if (unlikely(!tmp)) goto done;
36274 : Py_DECREF(stepval); stepval = tmp;
36275 : }
36276 : Py_DECREF(shift); shift = NULL;
36277 : Py_DECREF(mask); mask = NULL;
36278 : {
36279 : long idigit = PyLong_AsLong(stepval);
36280 : if (unlikely(idigit < 0)) goto done;
36281 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
36282 : if (unlikely(idigit >= (1L << remaining_bits)))
36283 : goto raise_overflow;
36284 : val |= ((long) idigit) << bits;
36285 : }
36286 : if (!is_unsigned) {
36287 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
36288 : goto raise_overflow;
36289 : if (is_negative)
36290 : val = ~val;
36291 : }
36292 : ret = 0;
36293 : done:
36294 : Py_XDECREF(shift);
36295 : Py_XDECREF(mask);
36296 : Py_XDECREF(stepval);
36297 : #endif
36298 : if (unlikely(ret))
36299 : return (long) -1;
36300 : return val;
36301 : }
36302 : raise_overflow:
36303 : PyErr_SetString(PyExc_OverflowError,
36304 : "value too large to convert to long");
36305 : return (long) -1;
36306 : raise_neg_overflow:
36307 : PyErr_SetString(PyExc_OverflowError,
36308 : "can't convert negative value to long");
36309 : return (long) -1;
36310 : }
36311 :
36312 : /* CIntFromPy */
36313 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
36314 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36315 : #pragma GCC diagnostic push
36316 : #pragma GCC diagnostic ignored "-Wconversion"
36317 : #endif
36318 : const char neg_one = (char) -1, const_zero = (char) 0;
36319 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
36320 : #pragma GCC diagnostic pop
36321 : #endif
36322 : const int is_unsigned = neg_one > const_zero;
36323 : #if PY_MAJOR_VERSION < 3
36324 : if (likely(PyInt_Check(x))) {
36325 : if ((sizeof(char) < sizeof(long))) {
36326 : __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
36327 : } else {
36328 : long val = PyInt_AS_LONG(x);
36329 : if (is_unsigned && unlikely(val < 0)) {
36330 : goto raise_neg_overflow;
36331 : }
36332 : return (char) val;
36333 : }
36334 : }
36335 : #endif
36336 : if (unlikely(!PyLong_Check(x))) {
36337 : char val;
36338 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
36339 : if (!tmp) return (char) -1;
36340 : val = __Pyx_PyInt_As_char(tmp);
36341 : Py_DECREF(tmp);
36342 : return val;
36343 : }
36344 : if (is_unsigned) {
36345 : #if CYTHON_USE_PYLONG_INTERNALS
36346 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
36347 : goto raise_neg_overflow;
36348 : } else if (__Pyx_PyLong_IsCompact(x)) {
36349 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
36350 : } else {
36351 : const digit* digits = __Pyx_PyLong_Digits(x);
36352 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36353 : switch (__Pyx_PyLong_DigitCount(x)) {
36354 : case 2:
36355 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36356 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36357 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36358 : } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
36359 : return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36360 : }
36361 : }
36362 : break;
36363 : case 3:
36364 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36365 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36366 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36367 : } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
36368 : return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36369 : }
36370 : }
36371 : break;
36372 : case 4:
36373 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36374 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36375 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36376 : } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
36377 : return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
36378 : }
36379 : }
36380 : break;
36381 : }
36382 : }
36383 : #endif
36384 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
36385 : if (unlikely(Py_SIZE(x) < 0)) {
36386 : goto raise_neg_overflow;
36387 : }
36388 : #else
36389 : {
36390 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36391 : if (unlikely(result < 0))
36392 : return (char) -1;
36393 : if (unlikely(result == 1))
36394 : goto raise_neg_overflow;
36395 : }
36396 : #endif
36397 : if ((sizeof(char) <= sizeof(unsigned long))) {
36398 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
36399 : #ifdef HAVE_LONG_LONG
36400 : } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
36401 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36402 : #endif
36403 : }
36404 : } else {
36405 : #if CYTHON_USE_PYLONG_INTERNALS
36406 : if (__Pyx_PyLong_IsCompact(x)) {
36407 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
36408 : } else {
36409 : const digit* digits = __Pyx_PyLong_Digits(x);
36410 : assert(__Pyx_PyLong_DigitCount(x) > 1);
36411 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
36412 : case -2:
36413 : if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
36414 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36415 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36416 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36417 : return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36418 : }
36419 : }
36420 : break;
36421 : case 2:
36422 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
36423 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
36424 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36425 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36426 : return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36427 : }
36428 : }
36429 : break;
36430 : case -3:
36431 : if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
36432 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36433 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36434 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36435 : return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36436 : }
36437 : }
36438 : break;
36439 : case 3:
36440 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
36441 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
36442 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36443 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36444 : return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36445 : }
36446 : }
36447 : break;
36448 : case -4:
36449 : if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
36450 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36451 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36452 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36453 : return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36454 : }
36455 : }
36456 : break;
36457 : case 4:
36458 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
36459 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
36460 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36461 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
36462 : return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
36463 : }
36464 : }
36465 : break;
36466 : }
36467 : }
36468 : #endif
36469 : if ((sizeof(char) <= sizeof(long))) {
36470 : __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
36471 : #ifdef HAVE_LONG_LONG
36472 : } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
36473 : __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
36474 : #endif
36475 : }
36476 : }
36477 : {
36478 : char val;
36479 : int ret = -1;
36480 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
36481 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
36482 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
36483 : if (unlikely(bytes_copied == -1)) {
36484 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
36485 : goto raise_overflow;
36486 : } else {
36487 : ret = 0;
36488 : }
36489 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
36490 : int one = 1; int is_little = (int)*(unsigned char *)&one;
36491 : unsigned char *bytes = (unsigned char *)&val;
36492 : ret = _PyLong_AsByteArray((PyLongObject *)x,
36493 : bytes, sizeof(val),
36494 : is_little, !is_unsigned);
36495 : #else
36496 : PyObject *v;
36497 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
36498 : int bits, remaining_bits, is_negative = 0;
36499 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
36500 : if (likely(PyLong_CheckExact(x))) {
36501 : v = __Pyx_NewRef(x);
36502 : } else {
36503 : v = PyNumber_Long(x);
36504 : if (unlikely(!v)) return (char) -1;
36505 : assert(PyLong_CheckExact(v));
36506 : }
36507 : {
36508 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
36509 : if (unlikely(result < 0)) {
36510 : Py_DECREF(v);
36511 : return (char) -1;
36512 : }
36513 : is_negative = result == 1;
36514 : }
36515 : if (is_unsigned && unlikely(is_negative)) {
36516 : Py_DECREF(v);
36517 : goto raise_neg_overflow;
36518 : } else if (is_negative) {
36519 : stepval = PyNumber_Invert(v);
36520 : Py_DECREF(v);
36521 : if (unlikely(!stepval))
36522 : return (char) -1;
36523 : } else {
36524 : stepval = v;
36525 : }
36526 : v = NULL;
36527 : val = (char) 0;
36528 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
36529 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
36530 : for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
36531 : PyObject *tmp, *digit;
36532 : long idigit;
36533 : digit = PyNumber_And(stepval, mask);
36534 : if (unlikely(!digit)) goto done;
36535 : idigit = PyLong_AsLong(digit);
36536 : Py_DECREF(digit);
36537 : if (unlikely(idigit < 0)) goto done;
36538 : val |= ((char) idigit) << bits;
36539 : tmp = PyNumber_Rshift(stepval, shift);
36540 : if (unlikely(!tmp)) goto done;
36541 : Py_DECREF(stepval); stepval = tmp;
36542 : }
36543 : Py_DECREF(shift); shift = NULL;
36544 : Py_DECREF(mask); mask = NULL;
36545 : {
36546 : long idigit = PyLong_AsLong(stepval);
36547 : if (unlikely(idigit < 0)) goto done;
36548 : remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
36549 : if (unlikely(idigit >= (1L << remaining_bits)))
36550 : goto raise_overflow;
36551 : val |= ((char) idigit) << bits;
36552 : }
36553 : if (!is_unsigned) {
36554 : if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
36555 : goto raise_overflow;
36556 : if (is_negative)
36557 : val = ~val;
36558 : }
36559 : ret = 0;
36560 : done:
36561 : Py_XDECREF(shift);
36562 : Py_XDECREF(mask);
36563 : Py_XDECREF(stepval);
36564 : #endif
36565 : if (unlikely(ret))
36566 : return (char) -1;
36567 : return val;
36568 : }
36569 : raise_overflow:
36570 : PyErr_SetString(PyExc_OverflowError,
36571 : "value too large to convert to char");
36572 : return (char) -1;
36573 : raise_neg_overflow:
36574 : PyErr_SetString(PyExc_OverflowError,
36575 : "can't convert negative value to char");
36576 : return (char) -1;
36577 : }
36578 :
36579 : /* FormatTypeName */
36580 : #if CYTHON_COMPILING_IN_LIMITED_API
36581 : static __Pyx_TypeName
36582 : __Pyx_PyType_GetName(PyTypeObject* tp)
36583 : {
36584 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
36585 : __pyx_n_s_name_2);
36586 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
36587 : PyErr_Clear();
36588 : Py_XDECREF(name);
36589 : name = __Pyx_NewRef(__pyx_n_s__38);
36590 : }
36591 : return name;
36592 : }
36593 : #endif
36594 :
36595 : /* CheckBinaryVersion */
36596 3 : static unsigned long __Pyx_get_runtime_version(void) {
36597 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
36598 3 : return Py_Version & ~0xFFUL;
36599 : #else
36600 : const char* rt_version = Py_GetVersion();
36601 : unsigned long version = 0;
36602 : unsigned long factor = 0x01000000UL;
36603 : unsigned int digit = 0;
36604 : int i = 0;
36605 : while (factor) {
36606 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
36607 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
36608 : ++i;
36609 : }
36610 : version += factor * digit;
36611 : if (rt_version[i] != '.')
36612 : break;
36613 : digit = 0;
36614 : factor >>= 8;
36615 : ++i;
36616 : }
36617 : return version;
36618 : #endif
36619 : }
36620 3 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
36621 3 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
36622 3 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
36623 : return 0;
36624 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
36625 : return 1;
36626 : {
36627 0 : char message[200];
36628 0 : PyOS_snprintf(message, sizeof(message),
36629 : "compile time Python version %d.%d "
36630 : "of module '%.100s' "
36631 : "%s "
36632 : "runtime version %d.%d",
36633 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
36634 : __Pyx_MODULE_NAME,
36635 : (allow_newer) ? "was newer than" : "does not match",
36636 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
36637 : );
36638 0 : return PyErr_WarnEx(NULL, message, 1);
36639 : }
36640 : }
36641 :
36642 : /* InitStrings */
36643 : #if PY_MAJOR_VERSION >= 3
36644 693 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
36645 693 : if (t.is_unicode | t.is_str) {
36646 690 : if (t.intern) {
36647 522 : *str = PyUnicode_InternFromString(t.s);
36648 168 : } else if (t.encoding) {
36649 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
36650 : } else {
36651 168 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
36652 : }
36653 : } else {
36654 3 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
36655 : }
36656 693 : if (!*str)
36657 : return -1;
36658 693 : if (PyObject_Hash(*str) == -1)
36659 : return -1;
36660 : return 0;
36661 : }
36662 : #endif
36663 3 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
36664 696 : while (t->p) {
36665 : #if PY_MAJOR_VERSION >= 3
36666 693 : __Pyx_InitString(*t, t->p);
36667 : #else
36668 : if (t->is_unicode) {
36669 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
36670 : } else if (t->intern) {
36671 : *t->p = PyString_InternFromString(t->s);
36672 : } else {
36673 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
36674 : }
36675 : if (!*t->p)
36676 : return -1;
36677 : if (PyObject_Hash(*t->p) == -1)
36678 : return -1;
36679 : #endif
36680 693 : ++t;
36681 : }
36682 3 : return 0;
36683 : }
36684 :
36685 : #include <string.h>
36686 0 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
36687 0 : size_t len = strlen(s);
36688 0 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
36689 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
36690 : return -1;
36691 : }
36692 : return (Py_ssize_t) len;
36693 : }
36694 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
36695 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
36696 : if (unlikely(len < 0)) return NULL;
36697 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
36698 : }
36699 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
36700 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
36701 : if (unlikely(len < 0)) return NULL;
36702 : return PyByteArray_FromStringAndSize(c_str, len);
36703 : }
36704 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
36705 : Py_ssize_t ignore;
36706 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
36707 : }
36708 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36709 : #if !CYTHON_PEP393_ENABLED
36710 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36711 : char* defenc_c;
36712 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
36713 : if (!defenc) return NULL;
36714 : defenc_c = PyBytes_AS_STRING(defenc);
36715 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36716 : {
36717 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
36718 : char* c;
36719 : for (c = defenc_c; c < end; c++) {
36720 : if ((unsigned char) (*c) >= 128) {
36721 : PyUnicode_AsASCIIString(o);
36722 : return NULL;
36723 : }
36724 : }
36725 : }
36726 : #endif
36727 : *length = PyBytes_GET_SIZE(defenc);
36728 : return defenc_c;
36729 : }
36730 : #else
36731 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36732 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
36733 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36734 : if (likely(PyUnicode_IS_ASCII(o))) {
36735 : *length = PyUnicode_GET_LENGTH(o);
36736 : return PyUnicode_AsUTF8(o);
36737 : } else {
36738 : PyUnicode_AsASCIIString(o);
36739 : return NULL;
36740 : }
36741 : #else
36742 : return PyUnicode_AsUTF8AndSize(o, length);
36743 : #endif
36744 : }
36745 : #endif
36746 : #endif
36747 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36748 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36749 : if (
36750 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36751 : __Pyx_sys_getdefaultencoding_not_ascii &&
36752 : #endif
36753 : PyUnicode_Check(o)) {
36754 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
36755 : } else
36756 : #endif
36757 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
36758 : if (PyByteArray_Check(o)) {
36759 : *length = PyByteArray_GET_SIZE(o);
36760 : return PyByteArray_AS_STRING(o);
36761 : } else
36762 : #endif
36763 : {
36764 : char* result;
36765 : int r = PyBytes_AsStringAndSize(o, &result, length);
36766 : if (unlikely(r < 0)) {
36767 : return NULL;
36768 : } else {
36769 : return result;
36770 : }
36771 : }
36772 : }
36773 635 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
36774 635 : int is_true = x == Py_True;
36775 635 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
36776 3 : else return PyObject_IsTrue(x);
36777 : }
36778 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
36779 : int retval;
36780 : if (unlikely(!x)) return -1;
36781 : retval = __Pyx_PyObject_IsTrue(x);
36782 : Py_DECREF(x);
36783 : return retval;
36784 : }
36785 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
36786 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
36787 : #if PY_MAJOR_VERSION >= 3
36788 0 : if (PyLong_Check(result)) {
36789 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
36790 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
36791 : "The ability to return an instance of a strict subclass of int is deprecated, "
36792 : "and may be removed in a future version of Python.",
36793 : result_type_name)) {
36794 0 : __Pyx_DECREF_TypeName(result_type_name);
36795 0 : Py_DECREF(result);
36796 0 : return NULL;
36797 : }
36798 : __Pyx_DECREF_TypeName(result_type_name);
36799 : return result;
36800 : }
36801 : #endif
36802 0 : PyErr_Format(PyExc_TypeError,
36803 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
36804 : type_name, type_name, result_type_name);
36805 0 : __Pyx_DECREF_TypeName(result_type_name);
36806 0 : Py_DECREF(result);
36807 : return NULL;
36808 : }
36809 0 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
36810 : #if CYTHON_USE_TYPE_SLOTS
36811 0 : PyNumberMethods *m;
36812 : #endif
36813 0 : const char *name = NULL;
36814 0 : PyObject *res = NULL;
36815 : #if PY_MAJOR_VERSION < 3
36816 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
36817 : #else
36818 0 : if (likely(PyLong_Check(x)))
36819 : #endif
36820 0 : return __Pyx_NewRef(x);
36821 : #if CYTHON_USE_TYPE_SLOTS
36822 0 : m = Py_TYPE(x)->tp_as_number;
36823 : #if PY_MAJOR_VERSION < 3
36824 : if (m && m->nb_int) {
36825 : name = "int";
36826 : res = m->nb_int(x);
36827 : }
36828 : else if (m && m->nb_long) {
36829 : name = "long";
36830 : res = m->nb_long(x);
36831 : }
36832 : #else
36833 0 : if (likely(m && m->nb_int)) {
36834 0 : name = "int";
36835 0 : res = m->nb_int(x);
36836 : }
36837 : #endif
36838 : #else
36839 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
36840 : res = PyNumber_Int(x);
36841 : }
36842 : #endif
36843 0 : if (likely(res)) {
36844 : #if PY_MAJOR_VERSION < 3
36845 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
36846 : #else
36847 0 : if (unlikely(!PyLong_CheckExact(res))) {
36848 : #endif
36849 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36850 : }
36851 : }
36852 0 : else if (!PyErr_Occurred()) {
36853 0 : PyErr_SetString(PyExc_TypeError,
36854 : "an integer is required");
36855 : }
36856 : return res;
36857 : }
36858 29 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
36859 29 : Py_ssize_t ival;
36860 29 : PyObject *x;
36861 : #if PY_MAJOR_VERSION < 3
36862 : if (likely(PyInt_CheckExact(b))) {
36863 : if (sizeof(Py_ssize_t) >= sizeof(long))
36864 : return PyInt_AS_LONG(b);
36865 : else
36866 : return PyInt_AsSsize_t(b);
36867 : }
36868 : #endif
36869 29 : if (likely(PyLong_CheckExact(b))) {
36870 : #if CYTHON_USE_PYLONG_INTERNALS
36871 29 : if (likely(__Pyx_PyLong_IsCompact(b))) {
36872 29 : return __Pyx_PyLong_CompactValue(b);
36873 : } else {
36874 0 : const digit* digits = __Pyx_PyLong_Digits(b);
36875 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
36876 0 : switch (size) {
36877 : case 2:
36878 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36879 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36880 : }
36881 : break;
36882 : case -2:
36883 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36884 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36885 : }
36886 : break;
36887 : case 3:
36888 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36889 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36890 : }
36891 : break;
36892 : case -3:
36893 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36894 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36895 : }
36896 : break;
36897 : case 4:
36898 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36899 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36900 : }
36901 : break;
36902 : case -4:
36903 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36904 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36905 : }
36906 : break;
36907 : }
36908 : }
36909 : #endif
36910 0 : return PyLong_AsSsize_t(b);
36911 : }
36912 0 : x = PyNumber_Index(b);
36913 0 : if (!x) return -1;
36914 0 : ival = PyInt_AsSsize_t(x);
36915 0 : Py_DECREF(x);
36916 : return ival;
36917 : }
36918 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
36919 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
36920 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
36921 : #if PY_MAJOR_VERSION < 3
36922 : } else if (likely(PyInt_CheckExact(o))) {
36923 : return PyInt_AS_LONG(o);
36924 : #endif
36925 : } else {
36926 : Py_ssize_t ival;
36927 : PyObject *x;
36928 : x = PyNumber_Index(o);
36929 : if (!x) return -1;
36930 : ival = PyInt_AsLong(x);
36931 : Py_DECREF(x);
36932 : return ival;
36933 : }
36934 : }
36935 343 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
36936 343 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
36937 : }
36938 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
36939 : return PyInt_FromSize_t(ival);
36940 : }
36941 :
36942 :
36943 : /* #### Code section: utility_code_pragmas_end ### */
36944 : #ifdef _MSC_VER
36945 : #pragma warning( pop )
36946 : #endif
36947 :
36948 :
36949 :
36950 : /* #### Code section: end ### */
36951 : #endif /* Py_PYTHON_H */
|